[richfaces-svn-commits] JBoss Rich Faces SVN: r2052 - trunk/docs/ajaxguide/en/src/main/docbook/included.
richfaces-svn-commits at lists.jboss.org
richfaces-svn-commits at lists.jboss.org
Fri Aug 3 11:25:47 EDT 2007
Author: vkukharchuk
Date: 2007-08-03 11:25:47 -0400 (Fri, 03 Aug 2007)
New Revision: 2052
Added:
trunk/docs/ajaxguide/en/src/main/docbook/included/loadBundle.xml
Modified:
trunk/docs/ajaxguide/en/src/main/docbook/included/ajaxListener.xml
trunk/docs/ajaxguide/en/src/main/docbook/included/loadBundle.desc.xml
Log:
http://jira.jboss.com/jira/browse/AJSF-107
http://jira.jboss.com/jira/browse/AJSF-105
Modified: trunk/docs/ajaxguide/en/src/main/docbook/included/ajaxListener.xml
===================================================================
--- trunk/docs/ajaxguide/en/src/main/docbook/included/ajaxListener.xml 2007-08-03 15:12:46 UTC (rev 2051)
+++ trunk/docs/ajaxguide/en/src/main/docbook/included/ajaxListener.xml 2007-08-03 15:25:47 UTC (rev 2052)
@@ -1,11 +1,74 @@
<?xml version="1.0" encoding="UTF-8"?>
-<root>
- <programlisting role="XML">
- <![CDATA[<a4j:region selfRendered="true" ajaxListener="#{bean.processAjax}" id="Region">
+<chapter>
+ <table>
+ <title>Component identification parameters </title>
+ <tgroup cols="2">
+ <thead>
+ <row>
+ <entry>Name</entry>
+ <entry>Value</entry>
+ </row>
+ </thead>
+ <tbody>
+
+ <row>
+ <entry>component-type</entry>
+ <entry>org.ajax4jsf.Listener</entry>
+ </row>
+ <row>
+ <entry>component-family</entry>
+ <entry>org.ajax4jsf.Listener</entry>
+ </row>
+ <row>
+ <entry>component-class</entry>
+ <entry>org.ajax4jsf.component.html.AjaxListener</entry>
+ </row>
+
+ </tbody>
+ </tgroup>
+ </table>
+
+ <!--
+ <section>
+ <title>Creating on a page</title>
+ <para>Simple Component definition on a page:</para>
- </a4j:region>]]>
- </programlisting>
- <para>
- Every time when AJAX request triggered from "region" method "processAjax" of "bean" will be called.
- </para>
-</root>
\ No newline at end of file
+ <para>
+ <emphasis role="bold">Example:</emphasis>
+ </para>
+
+ <programlisting role="XML"><![CDATA[<a4j:ajaxListenet type=""/>
+]]></programlisting>
+ </section>
+ -->
+
+ <section>
+ <title>Dynamical creation of a component from Java code</title>
+
+ <para>
+ <emphasis role="bold">Example:</emphasis>
+ <programlisting role="JAVA"><![CDATA[import org.ajax4jsf.component.html.AjaxListener;
+...
+AjaxListener myListener = new AjaxListener();
+...
+ ]]></programlisting>
+ </para>
+ </section>
+
+ <section>
+ <title>Key attributes and ways of usage</title>
+ <para>
+Additional to the listeners provided by JSF specification, RichFaces add one more: Ajax Listener (
+ <emphasis role="bold"><property><a4j:ajaxListener></property>
+ </emphasis>).
+Ajax Listener is invoked before the Render Response phase. Instead of Action Listener of Value Change Listener which are not
+invoked when Validation of Update Model phases failed, Ajax Listener is guarantied to be invoked for each Ajax response. So, it is
+a good place for update the list of re-rendered components, for example.
+Ajax Listener is not invoked for non-Ajax request and when RichFaces works in "Ajax Request generates
+Non-Ajax Response" mode. Therefore, Ajax Listener invocation is a good indicator that Ajax response is going to be processed.
+Attribute 'type' defines the fully qualified Java class name for listener. This class should implement org.ajax4jsf.events.AjaxListener interface.
+You can access to the source of the event (Ajax component) using event.getSource() call.
+ </para>
+
+ </section>
+</chapter>
\ No newline at end of file
Modified: trunk/docs/ajaxguide/en/src/main/docbook/included/loadBundle.desc.xml
===================================================================
--- trunk/docs/ajaxguide/en/src/main/docbook/included/loadBundle.desc.xml 2007-08-03 15:12:46 UTC (rev 2051)
+++ trunk/docs/ajaxguide/en/src/main/docbook/included/loadBundle.desc.xml 2007-08-03 15:25:47 UTC (rev 2052)
@@ -2,5 +2,6 @@
<section>
<para>The <emphasis role="bold">
<property><a4j:loadBundle></property>
- </emphasis> component is similar to the same component from the JSF Core library. The component loads a resource bundle localized for the Locale of the current view and exposes it (as a Map) in the request attributes of the current request.</para>
+ </emphasis> component is similar to the same component from the JSF Core library. The component loads a resource bundle
+ localized for the Locale of the current view and exposes it (as a Map) in the request attributes of the current request.</para>
</section>
\ No newline at end of file
Added: trunk/docs/ajaxguide/en/src/main/docbook/included/loadBundle.xml
===================================================================
--- trunk/docs/ajaxguide/en/src/main/docbook/included/loadBundle.xml (rev 0)
+++ trunk/docs/ajaxguide/en/src/main/docbook/included/loadBundle.xml 2007-08-03 15:25:47 UTC (rev 2052)
@@ -0,0 +1,85 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<chapter>
+ <table>
+ <title>Component identification parameters </title>
+ <tgroup cols="2">
+ <thead>
+ <row>
+ <entry>Name</entry>
+ <entry>Value</entry>
+ </row>
+ </thead>
+ <tbody>
+ <row>
+ <entry>component-type</entry>
+ <entry>org.ajax4jsf.Bundle</entry>
+ </row>
+ <row>
+ <entry>component-family</entry>
+ <entry>org.ajax4jsf.Bundle</entry>
+ </row>
+ <row>
+ <entry>component-class</entry>
+ <entry>org.ajax4jsf.component.html.AjaxLoadBundle</entry>
+ </row>
+ </tbody>
+ </tgroup>
+ </table>
+
+ <section>
+ <title>Creating on a page</title>
+
+ <para>Simple component definition on a page:</para>
+
+ <para>
+ <emphasis role="bold">Example:</emphasis>
+ <programlisting role="XML"><![CDATA[<a4j:loadBundle baseName="demo.bundle.Messages" var="Message"/>]]></programlisting>
+ </para>
+ </section>
+
+ <section>
+ <title>Dynamical creation of a component from Java code</title>
+
+ <para>
+ <emphasis role="bold">Example:</emphasis>
+ <programlisting role="JAVA"><![CDATA[import org.ajax4jsf.component.html.AjaxLoadBundle;
+...
+LoadBundle myBundle = new LoadBundle();
+...
+ ]]></programlisting>
+ </para>
+ </section>
+
+ <section>
+ <title>Key attributes and ways of usage</title>
+ <para>
+
+ <emphasis role="bold"><property><a4j:loadBundle></property>
+ </emphasis>allows to use reference to bundle messages during the Ajax re-rendering.
+<emphasis role="bold"><property><a4j:loadBundle></property>
+ </emphasis> is a substitute for the
+<emphasis role="bold"><property><f:loadBundle></property>
+ </emphasis> in JSF 1.1 which is not a JSF component originally.
+
+<emphasis role="bold"><property><f:loadBundle></property>
+ </emphasis> is a jsp tag that load the bundle messages into the request scope when page is rendered. As soon as each Ajax request
+works in own request scope, the bundles loaded with
+<emphasis role="bold"><property><f:loadBundle></property>
+ </emphasis> are unavailable.
+Instead of
+<emphasis role="bold"><property><f:loadBundle></property>
+ </emphasis> that might be located anywhere on the page, the
+
+ <emphasis role="bold"><property><a4j:loadBundle></property>
+ </emphasis> should be declared inside the
+
+ <emphasis role="bold"><property><f:view></property>
+ </emphasis> (this does not matter in case on using Facelets)
+JSF 1.2 introduces the bundle registered in the faces-config.xml. This fixed the problem with
+ <emphasis role="bold"><property><f:loadBundle></property>
+ </emphasis>.
+Therefore, you can use this JSF 1.2 way to declare your bundles.
+
+ </para>
+ </section>
+</chapter>
\ No newline at end of file
More information about the richfaces-svn-commits
mailing list