Author: SeanRogers
Date: 2010-03-12 01:34:41 -0500 (Fri, 12 Mar 2010)
New Revision: 16565
Modified:
root/docs/trunk/Component_Reference/en-US/chap-Component_Reference-Actions.xml
root/docs/trunk/Component_Reference/en-US/chap-Component_Reference-Functionality_extension.xml
Log:
Worked on a4j:componentControl
Modified: root/docs/trunk/Component_Reference/en-US/chap-Component_Reference-Actions.xml
===================================================================
---
root/docs/trunk/Component_Reference/en-US/chap-Component_Reference-Actions.xml 2010-03-12
01:13:14 UTC (rev 16564)
+++
root/docs/trunk/Component_Reference/en-US/chap-Component_Reference-Actions.xml 2010-03-12
06:34:41 UTC (rev 16565)
@@ -74,41 +74,6 @@
</para>
</section>
- <section id="sect-Component_Reference-Actions-a4jajax">
- <title><sgmltag><a4j:support></sgmltag></title>
- <itemizedlist>
- <listitem>
- <para>
- component-type: <classname>org.ajax4jsf.Support</classname>
- </para>
- </listitem>
- <listitem>
- <para>
- component-family: <classname>org.ajax4jsf.AjaxSupport</classname>
- </para>
- </listitem>
- <listitem>
- <para>
- component-class:
<classname>org.ajax4jsf.component.html.HtmlAjaxSupport</classname>
- </para>
- </listitem>
- <listitem>
- <para>
- renderer-type:
<classname>org.ajax4jsf.components.AjaxSupportRenderer</classname>
- </para>
- </listitem>
- </itemizedlist>
- <para>
- The <sgmltag><a4j:support></sgmltag> component allows Ajax
capability to be added to any non-Ajax component. It is placed as a direct child to the
component that requires Ajax support. The
<sgmltag><a4j:support></sgmltag> component uses the common
attributes listed in <xref
linkend="chap-Component_Reference-Common_Ajax_attributes" />.
- </para>
- <note>
- <title>Attaching JavaScript functions</title>
- <para>
- When attaching the <sgmltag><a4j:support></sgmltag>
component to non-Ajax JavaServer Faces command components, such as
<sgmltag><h:commandButton></sgmltag> and
<sgmltag><h:commandLink></sgmltag>, it is important to set
<code>disabledDefault="true"</code>. If this attribute is not set, a
non-Ajax request is sent after the Ajax request and the page is refreshed unexpectedly.
- </para>
- </note>
- </section>
-
<section id="sect-Component_Reference-Actions-a4jajaxListener">
<title><sgmltag><a4j:ajaxListener></sgmltag></title>
<itemizedlist>
@@ -235,6 +200,118 @@
</para>
</section>
+ <section
id="sect-Component_Reference-Functionality_extension-a4jcomponentControl">
+ <title><sgmltag><a4j:componentControl></sgmltag></title>
+ <remark>The following reference data is taken from the old
<sgmltag><rich:componentControl></sgmltag> reference. The
details may be different now that the component is part of the
<classname>a4j</classname> tag library.</remark>
+ <itemizedlist>
+ <listitem>
+ <para>
+ component-type: <classname>org.richfaces.ComponentControl</classname>
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ component-family: <classname>org.richfaces.ComponentControl</classname>
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ component-class:
<classname>org.richfaces.component.html.HtmlComponentControl</classname>
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ renderer-type:
<classname>org.richfaces.ComponentControlRenderer</classname>
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ tag-class:
<classname>org.richfaces.taglib.ComponentControlTag</classname>
+ </para>
+ </listitem>
+ </itemizedlist>
+ <para>
+ The <sgmltag><a4j:componentControl></sgmltag> allows
JavaScript API functions to be called on components after defined events. Initialization
variants and activation events can be customized, and parameters can be passed to the
target component.
+ </para>
+ <para>
+ The <varname>event</varname>, <varname>for</varname>, and
<varname>operation</varname> attributes are all that is required to attach
JavaScript functions to the parent component. The <varname>event</varname>
attribute specifies the event that triggers the JavaScript API function call. The
<varname>for</varname> attribute defines the target component, and the
<varname>operation</varname> attribute specifies the JavaScript function to
perform.
+ </para>
+ <example
id="exam-Component_Reference-a4jcomponentControl-a4jcomponentControl_basic_usage">
+ <title>a4j:componentControl basic usage</title>
+<programlisting language="XML"
role="XML"><h:commandButton value="Show Modal
Panel">
+ <!--componentControl is attached to the commandButton-->
+ <a4j:componentControl for="ccModalPanelID" event="onclick"
operation="show"/>
+</h:commandButton></programlisting>
+ <para>
+ The example contains a single command button, which when clicked shows the modal
panel with the identifier <literal>ccModalPanelID</literal>.
+ </para>
+ </example>
+ <para>
+ The <varname>attachTo</varname> attribute can be used to attach the event
to a component other than the parent component. If no
<varname>attachTo</varname> attribute is supplied, the
<sgmltag><a4j:componentControl></sgmltag> component's parent
is used, as in <xref
linkend="exam-Component_Reference-a4jcomponentControl-a4jcomponentControl_basic_usage"
/>.
+ </para>
+ <example
id="exam-Component_Reference-a4jcomponentControl-Attaching_a4jcomponentControl_to_a_component">
+ <title>Attaching
<sgmltag><a4j:componentControl></sgmltag> to a
component</title>
+<programlisting language="XML"
role="XML"><rich:componentControl
attachTo="doExpandCalendarID" event="onclick"
operation="Expand" for="ccCalendarID"
/></programlisting>
+ <para>
+ In the example, the <literal>onclick</literal> event of the component
with the identifier <literal>ccCalendarID</literal> will trigger the
<literal>Expand</literal> operation for the component with the identifier
<literal>doExpandCalendarID</literal>.
+ </para>
+ </example>
+ <para>
+ The operation can receive parameters either through the
<varname>params</varname> attribute, or by using
<sgmltag><f:param></sgmltag> elements.
+ </para>
+ <example
id="exam-Component_Reference-a4jcomponentControl-Using_parameters">
+ <title>Using parameters</title>
+ <variablelist>
+ <varlistentry>
+ <term>The <varname>params</varname> attribute</term>
+ <listitem>
+<programlisting language="XML"
role="XML"><rich:componentControl name="func"
event="onRowClick" for="menu" operation="show"
params="#{car.model}"/></programlisting>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term><sgmltag><f:param></sgmltag>
elements</term>
+ <listitem>
+<programlisting language="XML"
role="XML"><rich:componentControl event="onRowClick"
for="menu" operation="show">
+ <f:param value="#{car.model}" name="model"/>
+</rich:componentControl></programlisting>
+ </listitem>
+ </varlistentry>
+ </variablelist>
+ </example>
+ <para>
+ The <varname>name</varname> attribute can be used to define a normal
JavaScript function that triggers the specified operation on the target component.
+ </para>
+ <para>
+ The <varname>attachTiming</varname> attribute can determine the page
loading phase during which the
<sgmltag><a4j:componentControl></sgmltag> is attached to the
source component:
+ </para>
+ <variablelist>
+ <varlistentry>
+ <term><literal>immediate</literal></term>
+ <listitem>
+ <para>
+ attached during execution of the script.
+ </para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term><literal>onavailable</literal></term>
+ <listitem>
+ <para>
+ attached after the target component is initialized.
+ </para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term><literal>onload</literal></term>
+ <listitem>
+ <para>
+ attached after the page is loaded.
+ </para>
+ </listitem>
+ </varlistentry>
+ </variablelist>
+ </section>
+
<section id="sect-Component_Reference-Actions-a4jhtmlCommandLink">
<title><sgmltag><a4j:htmlCommandLink></sgmltag></title>
<itemizedlist>
@@ -384,6 +461,50 @@
The <varname>timeout</varname> attribute defines the response waiting time
in milliseconds. If a response isn't received within the timeout period, the
connection is aborted and the next request is sent. By default, the timeout is not set. In
combination with the <varname>interval</varname> attribute, checks for the
queue state can short polls or long connections.
</para>
</section>
+
+ <section id="sect-Component_Reference-Actions-a4jajax">
+ <title><sgmltag><a4j:support></sgmltag></title>
+ <itemizedlist>
+ <listitem>
+ <para>
+ component-type: <classname>org.ajax4jsf.Support</classname>
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ component-family: <classname>org.ajax4jsf.AjaxSupport</classname>
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ component-class:
<classname>org.ajax4jsf.component.html.HtmlAjaxSupport</classname>
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ renderer-type:
<classname>org.ajax4jsf.components.AjaxSupportRenderer</classname>
+ </para>
+ </listitem>
+ </itemizedlist>
+ <para>
+ The <sgmltag><a4j:support></sgmltag> component allows Ajax
capability to be added to any non-Ajax component. It is placed as a direct child to the
component that requires Ajax support. The
<sgmltag><a4j:support></sgmltag> component uses the common
attributes listed in <xref
linkend="chap-Component_Reference-Common_Ajax_attributes" />.
+ </para>
+ <note>
+ <title>Attaching JavaScript functions</title>
+ <para>
+ When attaching the <sgmltag><a4j:support></sgmltag>
component to non-Ajax JavaServer Faces command components, such as
<sgmltag><h:commandButton></sgmltag> and
<sgmltag><h:commandLink></sgmltag>, it is important to set
<code>disabledDefault="true"</code>. If this attribute is not set, a
non-Ajax request is sent after the Ajax request and the page is refreshed unexpectedly.
+ </para>
+ </note>
+ <example id="exam-Component_Reference-a4jsupport-a4jsupport_example">
+ <title><sgmltag><a4j:support></sgmltag>
example</title>
+ <programlisting language="XML" role="XML"><h:panelGrid
columns="2">
+ <h:inputText id="myinput"
value="#{userBean.name}">
+ <a4j:support event="onkeyup" reRender="outtext"
/>
+ </h:inputText>
+ <h:outputText id="outtext" value="#{userBean.name}"
/>
+</h:panelGrid></programlisting>
+ </example>
+ </section>
</chapter>
Modified:
root/docs/trunk/Component_Reference/en-US/chap-Component_Reference-Functionality_extension.xml
===================================================================
---
root/docs/trunk/Component_Reference/en-US/chap-Component_Reference-Functionality_extension.xml 2010-03-12
01:13:14 UTC (rev 16564)
+++
root/docs/trunk/Component_Reference/en-US/chap-Component_Reference-Functionality_extension.xml 2010-03-12
06:34:41 UTC (rev 16565)
@@ -6,13 +6,6 @@
<para>
Incomplete
</para>
- <section
id="sect-Component_Reference-Functionality_extension-richcomponentControl">
- <title><sgmltag><rich:componentControl></sgmltag></title>
- <para>
- Incomplete
- </para>
- </section>
-
<section
id="sect-Component_Reference-Functionality_extension-richgmap">
<title><sgmltag><rich:gmap></sgmltag></title>
<para>
Show replies by date