Author: cluts
Date: 2008-02-22 06:03:02 -0500 (Fri, 22 Feb 2008)
New Revision: 6281
Modified:
trunk/docs/userguide/en/src/main/docbook/included/support.xml
Log:
http://jira.jboss.com/jira/browse/RF-2099 - added the information in section "Key
attributes and ways of usage"
Modified: trunk/docs/userguide/en/src/main/docbook/included/support.xml
===================================================================
--- trunk/docs/userguide/en/src/main/docbook/included/support.xml 2008-02-22 11:02:25 UTC
(rev 6280)
+++ trunk/docs/userguide/en/src/main/docbook/included/support.xml 2008-02-22 11:03:02 UTC
(rev 6281)
@@ -63,9 +63,21 @@
</para>
<para><emphasis
role="bold">Example:</emphasis></para>
<programlisting role="XML"><![CDATA[<h:inputText
value="#{bean.text}">
- <a4j:support event="onkeyup" reRender="repeater"/>
+ <a4j:support event="onkeyup" reRender="output"
action="#{bean.action}"/>
</h:inputText>
]]></programlisting>
+
+ <para> Below you can see example Java code where support was added as facelets,
not children:</para>
+ <para><emphasis
role="bold">Example:</emphasis></para>
+ <programlisting role="JAVA"><![CDATA[
+HtmlInputText inputText = new HtmlInputText();
+...
+HtmlAjaxSupport ajaxSupport = new HtmlAjaxSupport();
+
ajaxSupport.setActionExpression(FacesContext.getCurrentInstance().getApplication().getExpressionFactory().createMethodExpression(FacesContext.getCurrentInstance().getELContext(),
"#{bean.action}", String.class, new Class[] {}));
+ ajaxSupport.setEvent("onkeyup");
+ ajaxSupport.setReRender("output");
+ inputText.getFacets().put("a4jsupport", ajaxSupport);
+]]></programlisting>
<para>Is decoded on a page as:</para>
<para>
@@ -149,7 +161,7 @@
Moreover, if the next request is already sent, the rerendering after the previous request
is banned, and
it helps to avoid unnecessary processing on the client.</para>
</listitem>
- </itemizedlist>
+ </itemizedlist>
</section>
<section>