Author: atsebro
Date: 2009-06-26 13:10:37 -0400 (Fri, 26 Jun 2009)
New Revision: 14735
Modified:
branches/community/3.3.X/docs/userguide/en/src/main/docbook/included/jsFunction.desc.xml
branches/community/3.3.X/docs/userguide/en/src/main/docbook/included/jsFunction.xml
Log:
RF-7426: a4j:jsFunction component description review
Modified:
branches/community/3.3.X/docs/userguide/en/src/main/docbook/included/jsFunction.desc.xml
===================================================================
---
branches/community/3.3.X/docs/userguide/en/src/main/docbook/included/jsFunction.desc.xml 2009-06-26
15:43:13 UTC (rev 14734)
+++
branches/community/3.3.X/docs/userguide/en/src/main/docbook/included/jsFunction.desc.xml 2009-06-26
17:10:37 UTC (rev 14735)
@@ -1,17 +1,15 @@
<?xml version="1.0" encoding="UTF-8"?>
<chapter>
- <section>
- <sectioninfo>
- <keywordset>
- <keyword>a4j:jsFunction</keyword>
- </keywordset>
- </sectioninfo>
-
- <title>Description</title>
- <para>
- The <emphasis role="bold">
- <property><a4j:jsFunction></property>
- </emphasis> component allows to invoke the server-side data and return it in
a JSON format to use in a client JavaScript calls.
- </para>
- </section>
+ <section>
+ <sectioninfo>
+ <keywordset>
+ <keyword>a4j:jsFunction</keyword>
+ </keywordset>
+ </sectioninfo>
+
+ <title>Description</title>
+ <para>
+ The <emphasis
role="bold"><property><a4j:jsFunction></property></emphasis>
component allows to perform Ajax requests directly from JavaScript code, invoke
server-side data and return it in a JSON format to use in a client JavaScript calls.
+ </para>
+ </section>
</chapter>
\ No newline at end of file
Modified:
branches/community/3.3.X/docs/userguide/en/src/main/docbook/included/jsFunction.xml
===================================================================
---
branches/community/3.3.X/docs/userguide/en/src/main/docbook/included/jsFunction.xml 2009-06-26
15:43:13 UTC (rev 14734)
+++
branches/community/3.3.X/docs/userguide/en/src/main/docbook/included/jsFunction.xml 2009-06-26
17:10:37 UTC (rev 14735)
@@ -36,28 +36,26 @@
</table>
<section>
- <title>Creating on a page</title>
- <para>Simple component definition example:</para>
-
- <para>
- <emphasis role="bold">Example:</emphasis>
- </para>
- <programlisting role="XML"><![CDATA[...
-<head>
- <script>
- <!--There is some script named "myScript" that uses parameters which will
be taken from server-->
- </script>
+ <title>Creating the Component with a Page Tag</title>
+ <para>To create the simpliest example of the component on the page use the
following syntax:</para>
+ <para>
+ <emphasis role="bold">Example:</emphasis>
+ </para>
+ <programlisting role="XML"><![CDATA[<head>
+ <script>
+ <!--There is some script named "myScript" that uses parameters which
will be taken from server-->
+ </script>
</head>
<body>
- ...
- <a4j:jsFunction data="#{bean.someProperty}" name="callScript"
oncomplete="myScript(data.subProperty1, data.subProperty2)"/>
- ...
-</body>
-...]]>
- </programlisting>
- <para> The script <code>"myScript"</code> is
called after
- <code>bean.someProperty</code> data is returned from server(e.g.
It'll
- be object with two subproperties). </para>
+ ...
+ <a4j:jsFunction data="#{bean.someProperty}"
name="callScript" oncomplete="myScript(data.subProperty1,
data.subProperty2)"/>
+ ...
+</body>]]>
+
+ </programlisting>
+ <para>
+ The script <code>"myScript"</code> is called
after <code>bean.someProperty</code> data is returned from server (e.g.
It'll be object with two subproperties).
+ </para>
</section>
<section>
<title>Creating the Component Dynamically Using Java</title>
@@ -71,71 +69,56 @@
...]]></programlisting>
</section>
<section>
- <title>Key attributes and ways of usage</title>
- <para> As the component uses Ajax request to get data from server - it has all
common Ajax
- Action attributes. Hence,
<emphasis><property>"action"</property></emphasis>
and<emphasis><property> "actionListener"
</property></emphasis>can be invoked, and reRendering some parts of
+ <title>Details of usage</title>
+
+ <para>
+ As the component uses Ajax request to get data from server it has all
common Ajax Action attributes.
+ Hence,
<emphasis><property>"action"</property></emphasis>
and<emphasis><property> "actionListener"
</property></emphasis>can be invoked, and reRendering some parts of
the page fired after calling function. </para>
<para> When using the <emphasis role="bold">
<property><a4j:jsFunction></property>
</emphasis> it's possible to initiate the Ajax request from the
JavaScript and
perform partial update of a page and/or invoke the JavaScript function with data
returned by
Ajax response. </para>
- <programlisting role="XML"><![CDATA[...
-<body onload="callScript()">
- ...
- <h:form>
- ...
- <a4j:jsFunction name="callScript"
data="#{bean.someProperty1}"
- reRender="someComponent"
oncomplete="myScript(data.subProperty1, data.subProperty2)">
- <a4j:actionparam name="param_name"
assignTo="#{bean.someProperty2}"/>
- </a4j:jsFunction>
- ...
- </h:form>
- ...
-</body>
-...]]></programlisting>
- <para> The <emphasis role="bold">
- <property><a4j:jsFunction></property>
- </emphasis> allows to use <emphasis role="bold">
- <property><a4j:actionparam></property>
- </emphasis> or pure <emphasis role="bold">
- <property><f:param></property>
- </emphasis> for passing any number of parameters of the JavaScript function
into Ajax request.
- <emphasis role="bold">
- <property><a4j:jsFunction></property>
- </emphasis> is similar to <emphasis role="bold">
- <property><a4j:commandButton></property>
- </emphasis>, but it could be activated from the JavaScript code. It allows to
invoke some
- server-side functionality and use the returned data in the JavaScript function
invoked from
-
<emphasis><property>"oncomplete"</property></emphasis>
attribute. Hence it's possible to use <emphasis
- role="bold">
- <property><a4j:jsFunction></property>
- </emphasis> instead of <emphasis role="bold">
- <property><a4j:commandButton></property>
- </emphasis>. You can put it anywhere, just don't forget to use
- <emphasis
role="bold"><property><h:form></property></emphasis>...
<emphasis
role="bold"><property></h:form></property></emphasis>
around it. </para>
+ <programlisting role="XML"><![CDATA[<body
onload="callScript()">
+ <h:form>
+ ...
+ <a4j:jsFunction name="callScript"
data="#{bean.someProperty1}" reRender="someComponent"
oncomplete="myScript(data.subProperty1, data.subProperty2)">
+ <a4j:actionparam name="param_name"
assignTo="#{bean.someProperty2}"/>
+ </a4j:jsFunction>
+ ...
+ </h:form>
+ ...
+ </body>]]></programlisting>
+
<para>
- Information about the
<emphasis><property>"process"</property></emphasis>
attribute usage you can find <link linkend="process">" Decide
what to process " </link> guide section.
+ The <emphasis
role="bold"><property><a4j:jsFunction></property></emphasis>
allows to use <emphasis
role="bold"><property><a4j:actionparam></property></emphasis>
or pure <emphasis
role="bold"><property><f:param></property></emphasis>
for passing any number of parameters of the JavaScript function into Ajax request.
+ <emphasis
role="bold"><property><a4j:jsFunction></property></emphasis>
is similar to <emphasis
role="bold"><property><a4j:commandButton></property></emphasis>,
but it could be activated from the JavaScript code.
+ It allows to invoke some server-side functionality and use the returned data in
the JavaScript function invoked from
<emphasis><property>"oncomplete"</property></emphasis>
attribute.
+ Hence it's possible to use <emphasis
role="bold"><property><a4j:jsFunction></property></emphasis>
instead of <emphasis
role="bold"><property><a4j:commandButton></property></emphasis>.
+ You can put it anywhere, just don't forget to use <emphasis
role="bold"><property><h:form></property></emphasis>
and <emphasis
role="bold"><property></h:form></property></emphasis>
around it.
</para>
+ <para>
+ Information about the
<emphasis><property>"process"</property></emphasis>
attribute usage you can find "<link linkend="process">Decide what
to process</link>" guide section.
+ </para>
</section>
<section>
<title>Relevant resources links</title>
<para>
- <ulink
-
url="http://www.jboss.org/community/docs/DOC-11856">
- Here
- </ulink>
- you can find additional information and example on how to use
- <emphasis role="bold">
- <property><a4j:jsFunction></property>
- </emphasis>
- with JSON.
+ Vizit the <ulink
url="http://livedemo.exadel.com/richfaces-demo/richfaces/jsFunction....
page</ulink> at RichFaces LiveDemo for component usage and sources for the given
examples.
</para>
- <para> <ulink
url="http://livedemo.exadel.com/richfaces-demo/richfaces/jsFunction....
the component Live Demo page</ulink>
- you can see the example of <emphasis role="bold"
-
><property><a4j:jsFunction></property></emphasis> usage
and sources for the given example.</para>
- <para>
- <ulink
url="http://java.sun.com/javaee/javaserverfaces/1.1_01/docs/tlddocs/...
RichFaces LiveDemo page </ulink> you can found some additional information about
<emphasis
role="bold"><property><f:param></property></emphasis>
component.
- </para>
+
+ <para>
+ Useful articles:
+ </para>
+ <itemizedlist>
+ <listitem>
+ <para>
+ "<ulink
url="http://www.jboss.org/community/docs/DOC-11856">JsFuncti...
article in the RichFaces Cookbook describes how to use <emphasis
role="bold"><property>"a4j:jsFunction"</property></emphasis>
to call the jsonTest backing bean that generates some random data in a JSON String;
+ </para>
+ </listitem>
+
+ </itemizedlist>
+
</section>
</chapter>