Author: cluts
Date: 2008-02-25 06:40:44 -0500 (Mon, 25 Feb 2008)
New Revision: 6317
Modified:
trunk/docs/faq/en/src/main/docbook/module/RFCfaq.xml
Log:
http://jira.jboss.com/jira/browse/RF-2099 - added the information in FAQ
Modified: trunk/docs/faq/en/src/main/docbook/module/RFCfaq.xml
===================================================================
--- trunk/docs/faq/en/src/main/docbook/module/RFCfaq.xml 2008-02-25 09:50:46 UTC (rev
6316)
+++ trunk/docs/faq/en/src/main/docbook/module/RFCfaq.xml 2008-02-25 11:40:44 UTC (rev
6317)
@@ -1777,5 +1777,30 @@
</h:form>
...]]></programlisting>
</section>
-
+ <section id="AddSupportAsFacet">
+ <title>How to add support as facet instead of children?</title>
+ <para>In order to add <emphasis role="bold">
+ <property><a4j:support></property>
+ </emphasis> in Java code you should add it as
<emphasis><property>facet</property></emphasis>, not
children:</para>
+ <para>
+ <emphasis role="bold">Example:</emphasis>
+ </para>
+ <programlisting role="XML"><![CDATA[...
+<h:inputText value="#{bean.text}">
+ <a4j:support event="onkeyup" reRender="output"
action="#{bean.action}"/>
+</h:inputText>
+...]]></programlisting>
+ <para>Below you can see Java code:</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>
+ </section>
</chapter>