Author: artdaw
Date: 2009-09-10 07:19:50 -0400 (Thu, 10 Sep 2009)
New Revision: 15522
Modified:
branches/community/3.3.X/docs/userguide/en/src/main/docbook/included/a4j_actionparam.xml
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_form.xml
Log:
https://jira.jboss.org/jira/browse/RF-7275 - <a4j:actionparam> was fixed
Modified:
branches/community/3.3.X/docs/userguide/en/src/main/docbook/included/a4j_actionparam.xml
===================================================================
---
branches/community/3.3.X/docs/userguide/en/src/main/docbook/included/a4j_actionparam.xml 2009-09-10
08:21:49 UTC (rev 15521)
+++
branches/community/3.3.X/docs/userguide/en/src/main/docbook/included/a4j_actionparam.xml 2009-09-10
11:19:50 UTC (rev 15522)
@@ -1,109 +1,160 @@
<section role="NotInToc" id="a4j_actionparam">
- <title>
- <
- a4j:actionparam
- >
- <emphasis role="since">
- <superscript> available since <emphasis
role="version">3.0.0</emphasis>
- </superscript>
- </emphasis>
- </title>
- <section role="NotInToc">
- <sectioninfo>
+ <title>
+ <
+ a4j:actionparam
+ >
+ <emphasis role="since">
+ <superscript>available since
+ <emphasis role="version">3.0.0</emphasis>
+ </superscript>
+ </emphasis>
+ </title>
+ <section role="NotInToc">
+ <sectioninfo>
<keywordset>
- <keyword>a4j:actionparam</keyword>
+ <keyword>a4j:actionparam</keyword>
</keywordset>
- </sectioninfo>
- <title>Description</title>
- <para>
- The <emphasis role="bold">
- <property><a4j:actionparam></property>
- </emphasis> component combines the functionality of both JSF <emphasis
role="bold">
- <property><f:param></property>
- </emphasis> and <emphasis role="bold">
- <property><f:actionListener></property>
- </emphasis>
- and allows to assign the value to the property of the manager bean directly
using the <emphasis>
- <property>assignTo</property>
- </emphasis> attribute.
- </para>
+ </sectioninfo>
+ <title>Description</title>
+ <para>
+ The
+ <emphasis role="bold">
+ <property><a4j:actionparam></property>
+ </emphasis>
+ component combines the functionality of
+ <emphasis role="bold">
+ <property><f:param></property>
+ </emphasis>
+ and
+ <emphasis role="bold">
+ <property><f:actionListener></property>
+ </emphasis>
+ and allows to assign the value to the property of the managed bean directly
using the
+ <emphasis>
+ <property>"assignTo"</property>
+ </emphasis>
+ attribute.
+ </para>
- </section>
- <section>
+ </section>
+ <section>
<title>Details of Usage</title>
- <para>
- The component <emphasis role="bold">
- <property><a4j:actionparam></property>
- </emphasis> is a combination of the functionality of two JSF tags:
- <emphasis role="bold">
- <property><f:param></property>
- </emphasis> and <emphasis role="bold">
- <property><f:actionListener></property>
- </emphasis>.
- </para>
- <para>At the render phase, it's decoded by parent component
(<emphasis role="bold">
- <property><h:commandLink></property>
- </emphasis> or like) as usual.
- At the process request phase, if the parent component performs an action
event, update the <emphasis>
- <property>"value"</property>
- </emphasis> specified in the
- <emphasis>
- <property>"assignTo"</property>
- </emphasis>attribute as its <emphasis>
- <property>"value"</property>
- </emphasis>.
- If a <emphasis>
- <property>"converter"</property>
- </emphasis> attribute is specified, use it to encode and decode the
<emphasis>
- <property>"value"</property>
- </emphasis> to a string stored in the html parameter.
- To make the <emphasis>
- <property>"assignTo"</property>
- </emphasis> attribute usable add the <code>actionParam</code>
instance to the parent component as an action listener.
+ <para>
+ The
+ <emphasis role="bold">
+ <property><a4j:actionparam></property>
+ </emphasis>
+ component has 3 main attributes:
</para>
+ <itemizedlist>
+ <listitem>
+ <para>
+ <emphasis>
+ <property>"name"</property>
+ </emphasis>
+ defines a name of this parameter
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ <emphasis>
+ <property>"value"</property>
+ </emphasis>
+ defines initial value of this parameter or a value binding
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ <emphasis>
+ <property>"assignTo"</property>
+ </emphasis>
+ defines updatable bean property. This property will be updated if the
parent
+ command component performs an actionEvent during the
"Process Request" phase.
+ </para>
+ </listitem>
+ </itemizedlist>
<para>
- <emphasis role="bold">
- <property><a4j:actionparam></property>
- </emphasis>has a <emphasis>
- <property>"noEscape"</property>
- </emphasis> attribute.
- If it is set to <property>"true"</property>, the
<emphasis>
- <property>"value"</property>
- </emphasis> is evaluated as a JavaScript code. </para>
+ <emphasis role="bold">Example:</emphasis>
+ </para>
+ <programlisting role="XML"><![CDATA[...
+<h:form id="form">
+ <a4j:commandButton value="Set Name to Alex"
reRender="rep">
+ <a4j:actionparam name="username" value="Alex"
assignTo="#{actionparamBean.name}"/>
+ </a4j:commandButton>
+ <br/>
+ <h:outputText id="rep" value="Name:
#{actionparamBean.name}"/>
+</h:form>
+...]]></programlisting>
<para>
- <emphasis role="bold">Example:</emphasis>
+ There is a managed bean:
</para>
- <programlisting role="XML"><![CDATA[...
-<script>
- ...
- var foo = "bar";
- ...
-</script>
-...
-<a4j:actionparam noEscape="true" name="param1"
value="foo" assignTo="#{bean.prop1}" />
+ <programlisting role="JAVA"><![CDATA[...
+public class ActionparamBean {
+ private String name = "John";
+
+ public String getName() {
+ return name;
+ }
+
+ public void setName(String name) {
+ this.name = name;
+ }
+}
...]]></programlisting>
- <para>
- The <emphasis role="bold">
- <property><a4j:param></property>
- </emphasis> extends <emphasis role="bold">
- <property><f:param></property>
- </emphasis>,
- so the <emphasis>
- <property>"name"</property>
- </emphasis> attribute is mandatory.
- Otherwise, the <emphasis>
- <property>"value"</property>
- </emphasis> misses due missing the request parameter name for it.
- </para>
+ <para>
+ You can use
+ <emphasis role="bold">
+ <property><a4j:actionparam></property>
+ </emphasis>
+ not only with Ajax components, but with non-ajax command component also.
+ This feature allows to update model values without invoking even a single
line of Java code on the
+ server side. The usage of this feature you can find at
+ <ulink
url="http://livedemo.exadel.com/richfaces-demo/richfaces/actionparam...
+ ActionParameter Usage
+ </ulink>
+ page of RichFaces LiveDemo.
+ </para>
+ <para>
+ If you need to convert the value before the "Update Model"
phase
+ you can specify the converter in the
+ <emphasis>
+ <property>"converter"</property>
+ </emphasis>
+ attribute.
+ </para>
+ <note>
+ <title>Note:</title>
+ <para>
+ The property is assigned with a parameter value on the "Update
Model" phase. Therefore if the
+ validation of the form is failed, this phase will be skipped and the
property won't be updated.
+ </para>
+ </note>
+ <para>
+ It is possible to use JavaScript expression or function in the
+ <emphasis>
+ <property>"value"</property>
+ </emphasis>
+ attribute.
+ In this case the
+ <emphasis>
+ <property>"noEscape"</property>
+ </emphasis>
+ attribute should be set to "true".
+ The result of this JavaScript invocation is sent to the server as a value of
+ <emphasis role="bold">
+ <property><a4j:actionparam></property>
+ </emphasis>
+ .
+ </para>
</section>
- <section>
- <title>Reference Data</title>
- <para>
- <ulink url="&tlddoc;a4j/actionparam.html">Table of
- <a4j:actionparam>
- attributes</ulink>.
- </para>
- <table frame="all">
+ <section>
+ <title>Reference Data</title>
+ <para>
+ <ulink url="&tlddoc;a4j/actionparam.html">Table of
+ <a4j:actionparam>
+ attributes</ulink>.
+ </para>
+ <table frame="all">
<title>Component Identification Parameters</title>
<tgroup cols="2">
<thead>
@@ -117,31 +168,42 @@
<entry>component-type</entry>
<entry>org.ajax4jsf.ActionParameter</entry>
</row>
-
+
<row>
<entry>component-class</entry>
<entry>org.ajax4jsf.component.html.HtmlActionParameter</entry>
</row>
-
+
</tbody>
</tgroup>
</table>
- </section>
- <section>
- <title>Relevant Resources Links</title>
+ </section>
+ <section>
+ <title>Relevant Resources Links</title>
<para>
- Visit the <ulink
url="http://livedemo.exadel.com/richfaces-demo/richfaces/actionparam...
page</ulink> at RichFaces LiveDemo for examples of component usage abd their
sources.
+ Visit the
+ <ulink
url="http://livedemo.exadel.com/richfaces-demo/richfaces/actionparam...
+ ActionParameter</ulink>
+ page at RichFaces LiveDemo for examples of component usage and their
sources.
</para>
<para>
- More information can be found on the <ulink
url="http://www.jboss.com/index.html?module=bb&op=viewtopic&...
Users Forum</ulink>.
- </para>
+ More information can be found on the
+ <ulink
+
url="http://www.jboss.com/index.html?module=bb&op=viewtopic&...
Users
+ Forum</ulink>.
+ </para>
<para>
- More information about <emphasis role="bold">
- <property><f:param></property>
- </emphasis> and <emphasis role="bold">
- <property><f:actionListener></property>
- </emphasis>can be found <ulink
url="http://java.sun.com/javaee/javaserverfaces/1.2/docs/tlddocs/ind...
Sun JSF TLD documentation</ulink>.
+ More information about
+ <emphasis role="bold">
+ <property><f:param></property>
+ </emphasis>
+ and
+ <emphasis role="bold">
+ <property><f:actionListener></property>
+ </emphasis>
+ can be found in
+ <ulink
url="http://java.sun.com/javaee/javaserverfaces/1.2/docs/tlddocs/ind...
JSF
+ TLD documentation</ulink>.
</para>
-
- </section>
+ </section>
</section>
\ No newline at end of file
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-10
08:21:49 UTC (rev 15521)
+++
branches/community/3.3.X/docs/userguide/en/src/main/docbook/included/a4j_ajaxListener.xml 2009-09-10
11:19:50 UTC (rev 15522)
@@ -70,9 +70,7 @@
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>
+
<property>java.util.EventObject.getSource()</property></ulink></code>
method.
</para>
<para>
@@ -95,7 +93,7 @@
<programlisting role="XML"><![CDATA[...
<rich:messages/>
-<h:form id="form" ajaxSubmit="true">
+<h:form id="form">
<a4j:commandLink value="Click to send Ajax request">
<a4j:ajaxListener type="org.docs.richfaces.actionListenerBean"/>
</a4j:commandLink>
@@ -172,12 +170,12 @@
<para>
Visit
<ulink
url="http://livedemo.exadel.com/richfaces-demo/richfaces/ajaxListene...
- AjaxListener
- </ulink>
+ AjaxListener</ulink>
page at RichFaces Livedemo for examples of component usage and their
sources.
</para>
<para>
- Check Sun JSF TLD documentation for more information on<ulink
+ 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>
Modified:
branches/community/3.3.X/docs/userguide/en/src/main/docbook/included/a4j_form.xml
===================================================================
---
branches/community/3.3.X/docs/userguide/en/src/main/docbook/included/a4j_form.xml 2009-09-10
08:21:49 UTC (rev 15521)
+++
branches/community/3.3.X/docs/userguide/en/src/main/docbook/included/a4j_form.xml 2009-09-10
11:19:50 UTC (rev 15522)
@@ -206,9 +206,10 @@
at RichFaces Livedemo for examples of component usage and their sources.
</para>
<para>
- For additional information about attributes of this component read<ulink
+ For additional information about attributes of this component read
+ <ulink
url="http://livedemo.exadel.com/richfaces-demo/richfaces/ajaxAttribu...
- Attribute' section</ulink>.
+ Attribute</ulink> section.
</para>
</section>
</section>
\ No newline at end of file