Author: artdaw
Date: 2009-09-09 15:16:39 -0400 (Wed, 09 Sep 2009)
New Revision: 15518
Added:
branches/community/3.3.X/docs/userguide/en/src/main/resources/images/ajaxListener.png
Modified:
branches/community/3.3.X/docs/userguide/en/src/main/docbook/included/a4j_ajaxListener.xml
Log:
https://jira.jboss.org/jira/browse/RF-7275 - a4j:actionListener is fixed
Modified:
branches/community/3.3.X/docs/userguide/en/src/main/docbook/included/a4j_ajaxListener.xml
===================================================================
---
branches/community/3.3.X/docs/userguide/en/src/main/docbook/included/a4j_ajaxListener.xml 2009-09-09
18:10:47 UTC (rev 15517)
+++
branches/community/3.3.X/docs/userguide/en/src/main/docbook/included/a4j_ajaxListener.xml 2009-09-09
19:16:39 UTC (rev 15518)
@@ -1,152 +1,185 @@
<section role="NotInToc" id="a4j_ajaxListener">
- <title>
- <
- a4j:ajaxListener
- >
- <emphasis role="since">
- <superscript> available since <emphasis
role="version">3.0.0</emphasis>
- </superscript>
- </emphasis>
- </title>
- <section>
- <title>Description</title>
- <para>The component adds an action listener to a parent component to
provide possibility of Ajax update.
- It works like the <emphasis role="bold">
- <property><f:actionListener></property>
- </emphasis> or <emphasis role="bold">
- <property><f:valueChangeListener></property>
- </emphasis> JSF components
- but for the whole Ajax container.
- </para>
- </section>
- <section>
- <title>Key Features</title>
- <itemizedlist>
- <listitem>
- <para>The listener is invoked for Ajax requests only</para>
- </listitem>
- <listitem>
- <para>The listener is always guaranteed to be invoked</para>
- </listitem>
- </itemizedlist>
+ <title>
+ <
+ a4j:ajaxListener
+ >
+ <emphasis role="since">
+ <superscript>available since
+ <emphasis role="version">3.0.0</emphasis>
+ </superscript>
+ </emphasis>
+ </title>
+ <section>
+ <title>Description</title>
+ <para>The
+ <emphasis role="bold">
+ <property><a4j:ajaxListener></property>
+ </emphasis>
+ component adds an action listener to a parent component and works like the
+ <emphasis role="bold">
+ <property><f:actionListener></property>
+ </emphasis>
+ or
+ <emphasis role="bold">
+ <property><f:valueChangeListener></property>
+ </emphasis>
+ JSF components
+ but for the whole Ajax container.
+ </para>
</section>
- <section>
- <title>Details of Usage</title>
- <para>The <emphasis role="bold">
- <property><a4j:ajaxListener></property>
- </emphasis> component adds an action listener to a parent component, which
needs to be provided with Ajax support.
- That listener is invoked on each Ajax request during the "Render
Response" JSF phase.
- In comparison with JSF <emphasis role="bold">
- <property><f:actionListener></property>
- </emphasis> and <emphasis role="bold">
- <property><f:valueChangeListener></property>
- </emphasis>
- the invocation of the <emphasis role="bold">
- <property><a4j:ajaxListener></property>
- </emphasis> is not skipped in case when validation of Update Model fails.
- The <emphasis role="bold">
- <property><a4j:ajaxListener></property>
- </emphasis> is guarantied to be invoked for each Ajax response.
- </para>
-
- <note>
- <para>
- Ajax listener is not invoked for non-Ajax requests and when RichFaces works
in the "Ajax Request generates Non-Ajax Response" mode.
- </para>
- </note>
+ <section>
+ <title>Details of Usage</title>
+ <para>The
+ <emphasis role="bold">
+ <property><a4j:ajaxListener></property>
+ </emphasis>
+ component adds an action listener to a parent component.
+ That listener is invoked on each Ajax request during the "Render
Response" JSF phase.
+ In comparison with standard JSF
+ <emphasis role="bold">
+ <property><f:actionListener></property>
+ </emphasis>
+ and
+ <emphasis role="bold">
+ <property><f:valueChangeListener></property>
+ </emphasis>
+ components the invocation of the
+ <emphasis role="bold">
+ <property><a4j:ajaxListener></property>
+ </emphasis>
+ is not skipped in case when validation of "Update Model"
fails.
+ The
+ <emphasis role="bold">
+ <property><a4j:ajaxListener></property>
+ </emphasis>
+ is guarantied to be invoked for each Ajax response.
+ </para>
+ <para>
+ The
+ <emphasis>
+ <property>"type"</property>
+ </emphasis>
+ attribute defines the fully qualified Java class name for the listener.
+ This Java class should implement
+ <code>
+ <ulink
url="&apidoc_framework;org/ajax4jsf/event/AjaxListener.html">
+ <property>org.ajax4jsf.event.AjaxListener</property>
+ </ulink>
+ </code>
+ interface which is base interface for all listeners, capable for receiving
Ajax events.
+ The object on which the Event initially occurred could be accessed using the
+ <code>
+ <ulink
url="http://java.sun.com/j2se/1.4.2/docs/api/java/util/EventObject.h...
+ <property>java.util.EventObject.getSource()</property>
+ </ulink>
+ </code>
+ method.
+ </para>
+ <para>
+ The
+ <emphasis role="bold">
+ <property><a4j:ajaxListener></property>
+ </emphasis>
+ is not invoked for non-Ajax requests and when RichFaces works in the
"Ajax Request
+ generates Non-Ajax Response" mode, so
+ <emphasis role="bold">
+ <property><a4j:ajaxListener></property>
+ </emphasis>
+ invocation is a good indicator that Ajax
+ Response is going to be processed. Let's check it in the following
example.
+ </para>
- <para>
- As example of the <emphasis role="bold">
- <property><a4j:ajaxListener></property>
- </emphasis> component usage one can cite an updating the list of
re-rendered components.
-</para>
+ <para>
+ <emphasis role="bold">Example:</emphasis>
+ </para>
- <para>
- The <emphasis>
- <property>"type"</property>
- </emphasis> attribute defines the fully qualified Java class name for the
listener.
- This Java class implements <code>
- <ulink
url="&apidoc_framework;org/ajax4jsf/event/AjaxListener.html">
- <property>org.ajax4jsf.event.AjaxListener</property>
- </ulink>
- </code>interface, which is base interface for all listeners, capable for
receiving Ajax events.
- The source of the event could be accessed using the <code>
- <ulink
url="http://java.sun.com/j2se/1.4.2/docs/api/java/util/EventObject.h...
- <property>java.util.EventObject.getSource()</property>
- </ulink>
- </code> call.
-</para>
+ <programlisting role="XML"><![CDATA[...
+<rich:messages/>
+<h:form id="form" ajaxSubmit="true">
+ <a4j:commandLink value="Click to send Ajax request">
+ <a4j:ajaxListener type="org.docs.richfaces.actionListenerBean"/>
+ </a4j:commandLink>
+</h:form>
+...]]></programlisting>
+ <para>
+ <emphasis role="bold">Example:</emphasis>
+ </para>
-
- <para>
- <emphasis role="bold">Example:</emphasis>
- </para>
+ <programlisting role="JAVA"><![CDATA[...
+public class actionListenerBean implements org.ajax4jsf.event.AjaxListener {
+ public void processAjax(AjaxEvent event) {
+ FacesContext.getCurrentInstance().addMessage("form", new
FacesMessage("Ajax request is sent"));
+ }
+}
+...]]></programlisting>
+ <para>
+ There is a result:
+ </para>
+ <figure>
+ <title>
+ Usage of the
+ <emphasis role="bold">
+ <property><a4j:ajaxListener></property>
+ </emphasis>
+ </title>
+ <mediaobject>
+ <imageobject>
+ <imagedata fileref="images/ajaxListener.png"/>
+ </imageobject>
+ </mediaobject>
+ </figure>
- <programlisting role="XML"><![CDATA[...
-<a4j:commandLink id="cLink" value="Click it To Send Ajax
Request">
- <a4j:ajaxListener type="demo.Bean"/>
-</a4j:commandLink>
-...]]></programlisting>
- <para>
- <emphasis role="bold">Example:</emphasis>
- </para>
+ </section>
+ <section>
+ <title>Reference Data</title>
+ <para>
+ <ulink url="&tlddoc;a4j/ajaxListener.html">Table of
+ <a4j:ajaxListener>
+ attributes</ulink>.
+ </para>
+ <table>
+ <title>Component Identification Parameters</title>
+ <tgroup cols="2">
+ <thead>
+ <row>
+ <entry>Name</entry>
+ <entry>Value</entry>
+ </row>
+ </thead>
+ <tbody>
- <programlisting role="JAVA"><![CDATA[package demo;
+ <row>
+ <entry>listener-class</entry>
+ <entry>org.ajax4jsf.event.AjaxListener</entry>
+ </row>
+ <row>
+ <entry>event-class</entry>
+ <entry>org.ajax4jsf.event.AjaxEvent</entry>
+ </row>
-import org.ajax4jsf.event.AjaxEvent;
-
-public class Bean implements org.ajax4jsf.event.AjaxListener{
- ...
- public void processAjax(AjaxEvent arg){
- //Custom Developer Code
- }
- ...
-}]]></programlisting>
- </section>
- <section>
- <title>Reference Data</title>
- <para>
- <ulink url="&tlddoc;a4j/ajaxListener.html">Table of
- <a4j:ajaxListener>
- attributes</ulink>.
- </para>
- <table>
- <title>Component Identification Parameters </title>
- <tgroup cols="2">
- <thead>
- <row>
- <entry>Name</entry>
- <entry>Value</entry>
- </row>
- </thead>
- <tbody>
-
- <row>
- <entry>listener-class</entry>
- <entry>org.ajax4jsf.event.AjaxListener</entry>
- </row>
- <row>
- <entry>event-class</entry>
- <entry>org.ajax4jsf.event.AjaxEvent</entry>
- </row>
-
- <row>
- <entry>tag-class</entry>
-
<entry>org.ajax4jsf.taglib.html.jsp.AjaxListenerTag</entry>
- </row>
- </tbody>
- </tgroup>
- </table>
- </section>
- <section>
- <title>Relevant Resources Links</title>
- <para>
- Visit <ulink
url="http://livedemo.exadel.com/richfaces-demo/richfaces/ajaxListene...
page at RichFaces Livedemo for examples of component usage and their sources.
- </para>
+ <row>
+ <entry>tag-class</entry>
+
<entry>org.ajax4jsf.taglib.html.jsp.AjaxListenerTag</entry>
+ </row>
+ </tbody>
+ </tgroup>
+ </table>
+ </section>
+ <section>
+ <title>Relevant Resources Links</title>
<para>
- Check Sun JSF TLD documentation for more information on <ulink
url="http://java.sun.com/javaee/javaserverfaces/1.1_01/docs/tlddocs/...
tag</ulink>.
+ Visit
+ <ulink
url="http://livedemo.exadel.com/richfaces-demo/richfaces/ajaxListene...
+ AjaxListener
+ </ulink>
+ page at RichFaces Livedemo for examples of component usage and their
sources.
</para>
- </section>
+ <para>
+ Check Sun JSF TLD documentation for more information on<ulink
+
url="http://java.sun.com/javaee/javaserverfaces/1.1_01/docs/tlddocs/...
+ tag</ulink>.
+ </para>
+ </section>
</section>
Added:
branches/community/3.3.X/docs/userguide/en/src/main/resources/images/ajaxListener.png
===================================================================
(Binary files differ)
Property changes on:
branches/community/3.3.X/docs/userguide/en/src/main/resources/images/ajaxListener.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream