JBoss Rich Faces SVN: r22366 - in modules/docs/trunk/Component_Reference/src/main/docbook/en-US: extras and 1 other directories.
by richfaces-svn-commits@lists.jboss.org
Author: SeanRogers
Date: 2011-04-05 03:32:40 -0400 (Tue, 05 Apr 2011)
New Revision: 22366
Added:
modules/docs/trunk/Component_Reference/src/main/docbook/en-US/extras/exam-Component_Reference-richmessage-Message_icons.css
modules/docs/trunk/Component_Reference/src/main/docbook/en-US/skinning/tabl-richmessages.xml
Modified:
modules/docs/trunk/Component_Reference/src/main/docbook/en-US/chap-Component_Reference-Drag_and_drop.xml
modules/docs/trunk/Component_Reference/src/main/docbook/en-US/chap-Component_Reference-Output_and_messages.xml
modules/docs/trunk/Component_Reference/src/main/docbook/en-US/extras/exam-Component_Reference-richmessage-richmessage_example.xml_sample
modules/docs/trunk/Component_Reference/src/main/docbook/en-US/extras/exam-Component_Reference-richprogressBar-Initial_and_complete_states.xml_sample
modules/docs/trunk/Component_Reference/src/main/docbook/en-US/extras/exam-Component_Reference-richprogressBar-Using_nested_child_components.xml_sample
modules/docs/trunk/Component_Reference/src/main/docbook/en-US/extras/exam-Component_Reference-richprogressBar-Using_the_label_attribute.xml_sample
modules/docs/trunk/Component_Reference/src/main/docbook/en-US/extras/exam-Component_Reference-richtoolTip-Attaching_the_tool-tip.xml_sample
modules/docs/trunk/Component_Reference/src/main/docbook/en-US/skinning/vlst-richdragIndicator.xml
Log:
Completed up to Drag and Drop from Engineering review (RFPL-1380) including message icon details (RFPL-1123)
Modified: modules/docs/trunk/Component_Reference/src/main/docbook/en-US/chap-Component_Reference-Drag_and_drop.xml
===================================================================
--- modules/docs/trunk/Component_Reference/src/main/docbook/en-US/chap-Component_Reference-Drag_and_drop.xml 2011-04-05 00:21:23 UTC (rev 22365)
+++ modules/docs/trunk/Component_Reference/src/main/docbook/en-US/chap-Component_Reference-Drag_and_drop.xml 2011-04-05 07:32:40 UTC (rev 22366)
@@ -30,7 +30,7 @@
Use the <varname>dragIndicator</varname> parameter to customize the appearance of a dragged object while it is being dragged. The <varname>dragIndicator</varname> parameter must point to the <varname>id</varname> identifier of a <sgmltag><rich:dragIndicator></sgmltag> component. If the <varname>dragIndicator</varname> attribute is not defined, the drag indicator appears as a clone of the <sgmltag><rich:dragSource></sgmltag> component's parent control.
</para>
<para>
- To bind data to the dragged object, use the <varname>dragValue</varname> attribute. The <varname>dragValue</varname> attribute specifies an item in a data model, which is then bound to the parent component when it is dragged. This facilitates handling event data during a drop event.
+ To bind data to the dragged object, use the <varname>dragValue</varname> attribute. The <varname>dragValue</varname> attribute specifies a server-side object, which is then bound to the parent component when it is dragged. This facilitates handling event data during a drop event.
</para>
</section>
@@ -70,7 +70,7 @@
<section id="sect-Component_Reference-Drag_and_drop-richdropTarget">
<title><sgmltag><rich:dropTarget></sgmltag></title>
<para>
- The <sgmltag><rich:dropTarget></sgmltag> component can be added to a component so that the component can accept dragged items. The dragged items must support the <sgmltag><rich:dragSource></sgmltag> component, and be of a compatible drop type.
+ The <sgmltag><rich:dropTarget></sgmltag> component can be added to a component so that the component can accept dragged items. The dragged items must be defined with a compatible drop type for the <sgmltag><rich:dragSource></sgmltag> component.
</para>
<section id="sect-Component_Reference-richdropTarget-Basic_usage">
@@ -89,7 +89,7 @@
<section id="sect-Component_Reference-richdropTarget-Handling_dropped_data">
<title>Handling dropped data</title>
<para>
- To provide additional parameters for a drop event, use the <varname>dropValue</varname> attribute.
+ To provide additional parameters for the server-side drop event, use the <varname>dropValue</varname> attribute.
</para>
<para>
The <sgmltag><rich:dropTarget></sgmltag> component raises the <varname>DropEvent</varname> server-side event when an object is dropped. The event uses the following parameters:
@@ -159,21 +159,8 @@
<section id="sect-Component_Reference-richdragIndicator-Basic_usage">
<title>Basic usage</title>
<para>
- If included without any attributes specified, the drag indicator will appear as an empty dotted outline, as shown in
+ To use a drag indicator, define the inner content that appears during a drag event. No additional attributes are required. If a drag indicator is not used, a clone of the drag source is used instead.
</para>
- <figure id="figu-Component_Reference-richdragIndicator-An_empty_drag_indicator">
- <title>An empty drag indicator</title>
- <mediaobject>
- <imageobject>
- <imagedata fileref="images/figu-Component_Reference-richdragIndicator-An_empty_drag_indicator.png" format="PNG" />
- </imageobject>
- <textobject>
- <para>
- An empty drag indicator appears as an empty dotted outline.
- </para>
- </textobject>
- </mediaobject>
- </figure>
</section>
<section id="sect-Component_Reference-richdragIndicator-Styling_the_indicator">
Modified: modules/docs/trunk/Component_Reference/src/main/docbook/en-US/chap-Component_Reference-Output_and_messages.xml
===================================================================
--- modules/docs/trunk/Component_Reference/src/main/docbook/en-US/chap-Component_Reference-Output_and_messages.xml 2011-04-05 00:21:23 UTC (rev 22365)
+++ modules/docs/trunk/Component_Reference/src/main/docbook/en-US/chap-Component_Reference-Output_and_messages.xml 2011-04-05 07:32:40 UTC (rev 22366)
@@ -11,8 +11,11 @@
<section id="sect-Component_Reference-Output_and_messages-richmessage">
<title><sgmltag><rich:message></sgmltag></title>
<para>
- The <sgmltag><rich:message></sgmltag> component renders a single message relating to another specific component. The message consists of two parts, both of which are optional: the marker icon and the textual label. The appearance of the message can be customized, and tool-tips can be used for further information about the message.
+ The <sgmltag><rich:message></sgmltag> component renders a single <classname>FacesMessage</classname> message instance added for the component. The appearance of the message can be customized, and tool-tips can be used for further information about the message.
</para>
+ <para>
+ The <sgmltag><rich:message></sgmltag> component is rendered in the same way as the standard <sgmltag><h:message></sgmltag> component, but allows separate styling of the message summary and detail. It allows unified icons to be set using background images in predefined classes.
+ </para>
<figure id="figu-Component_Reference-richmessage-richmessage_component">
<title>rich:message component</title>
<mediaobject>
@@ -30,67 +33,34 @@
<section id="sect-Component_Reference-richmessage-Basic_usage">
<title>Basic usage</title>
<para>
- The <sgmltag><rich:message></sgmltag> component needs the <varname>for</varname> attribute to point to the <varname>id</varname> identifier of the related component. The message is displayed depending on the state of the linked component's requests.
+ The <sgmltag><rich:message></sgmltag> component needs the <varname>for</varname> attribute to point to the <varname>id</varname> identifier of the related component. The message is displayed after the <classname>FacesMessage</classname> message instance is created and added for the client identifier of the related component.
</para>
<para>
- The <sgmltag><rich:message></sgmltag> component is automatically rendered after an Ajax request, even without the use of an <sgmltag><a4j:outputPanel></sgmltag> component.
+ The <sgmltag><rich:message></sgmltag> component is automatically rendered after an Ajax request. This occurs without the use of an <sgmltag><a4j:outputPanel></sgmltag> component or a specific reference through the <varname>render</varname> attribute of the Ajax request source.
</para>
+ <example id="exam-Component_Reference-richmessage-richmessage_example">
+ <title>rich:message example</title>
+ <programlisting language="XML" role="XML"><xi:include href="extras/exam-Component_Reference-richmessage-richmessage_example.xml_sample" parse="text" xmlns:xi="http://www.w3.org/2001/XInclude" /></programlisting>
+ <para>
+ The example contains a text input for zip codes. The simple validation requires the entered zip code to be between 4 and 9 characters long. The <sgmltag><rich:message></sgmltag> component references the input box, and reports any messages relating to the input validation.
+ </para>
+ </example>
</section>
<section id="sect-Component_Reference-richmessage-Appearance">
<title>Appearance</title>
<para>
- The <varname>passedLabel</varname> attribute contains a message to display when there are no errors; that is, when validation passes successfully. The <varname>showSummary</varname> attribute specifies whether to display only a summary of the full message. The full message can be displayed in a tool-tip when hovering the mouse over the summary.
+ The <varname>showSummary</varname> attribute specifies whether to display only a summary of the full message. The full message can be displayed in a tool-tip when hovering the mouse over the summary.
</para>
<para>
- Facets are used to define the marker icons for different message states:
+ Use CSS (Cascading Style Sheets) to customize the appearance and icon for the <sgmltag><rich:message></sgmltag> component. To use a custom icon, set the <property>background-image</property> property to the icon graphic, as shown in <xref linkend="exam-Component_Reference-richmessage-Message_icons" />. Refer to <xref linkend="sect-Component_Reference-richmessage-Style_classes_and_skin_parameters" /> for a complete list of style classes for the <sgmltag><rich:message></sgmltag> component.
</para>
- <variablelist>
- <varlistentry>
- <term><literal>errorMarker</literal></term>
- <listitem>
- <para>
- Defines the icon for messages with the <literal>error</literal> severity class.
- </para>
- </listitem>
- </varlistentry>
- <varlistentry>
- <term><literal>fatalMarker</literal></term>
- <listitem>
- <para>
- Defines the icon for messages with the <literal>fatal</literal> severity class.
- </para>
- </listitem>
- </varlistentry>
- <varlistentry>
- <term><literal>infoMarker</literal></term>
- <listitem>
- <para>
- Defines the icon for messages with the <literal>info</literal> severity class.
- </para>
- </listitem>
- </varlistentry>
- <varlistentry>
- <term><literal>passedMarker</literal></term>
- <listitem>
- <para>
- Defines the icon for messages that are not of the <literal>error</literal>, <literal>fatal</literal>, <literal>info</literal>, or <literal>warn</literal> severity classes.
- </para>
- </listitem>
- </varlistentry>
- <varlistentry>
- <term><literal>warnMarker</literal></term>
- <listitem>
- <para>
- Defines the icon for messages with the <literal>warn</literal> severity class.
- </para>
- </listitem>
- </varlistentry>
- </variablelist>
- <example id="exam-Component_Reference-richmessage-richmessage_example">
- <title>rich:message example</title>
- <programlisting language="XML" role="XML"><xi:include href="extras/exam-Component_Reference-richmessage-richmessage_example.xml_sample" parse="text" xmlns:xi="http://www.w3.org/2001/XInclude" />
- </programlisting>
+ <example id="exam-Component_Reference-richmessage-Message_icons">
+ <title>Message icons</title>
+ <programlisting><xi:include href="extras/exam-Component_Reference-richmessage-Message_icons.css" parse="text" xmlns:xi="http://www.w3.org/2001/XInclude" /></programlisting>
+ <para>
+ The example demonstrates how an icon for an error message could be added using CSS.
+ </para>
</example>
</section>
@@ -135,7 +105,7 @@
<section id="sect-Component_Reference-Output_and_messages-richmessages">
<title><sgmltag><rich:messages></sgmltag></title>
<para>
- The <sgmltag><rich:messages></sgmltag> components works similarly to the <sgmltag><rich:message></sgmltag> component, but can display validation messages for a group of components instead of just a single component. Refer to <xref linkend="sect-Component_Reference-Output_and_messages-richmessage" /> for details on the <sgmltag><rich:message></sgmltag> component.
+ The <sgmltag><rich:messages></sgmltag> components works similarly to the <sgmltag><rich:message></sgmltag> component, but can display all the validation messages added for the current view instead of just a single message. Refer to <xref linkend="sect-Component_Reference-Output_and_messages-richmessage" /> for details on the <sgmltag><rich:message></sgmltag> component.
</para>
<figure id="figu-Component_Reference-richmessages-richmessages_component">
<title>rich:messages component</title>
@@ -154,68 +124,27 @@
<section id="sect-Component_Reference-richmessages-Basic_usage">
<title>Basic usage</title>
<para>
- The <sgmltag><rich:messages></sgmltag> component doesn't require any extra attributes for basic usage. It displays all messages relating to requests from components in the same container element.
+ The <sgmltag><rich:messages></sgmltag> component doesn't require any extra attributes for basic usage. It displays all messages relating to requests from components.
</para>
<para>
- The <sgmltag><rich:message></sgmltag> component is automatically rendered after an Ajax request, even without the use of an <sgmltag><a4j:outputPanel></sgmltag> component.
+ To limit the messages to a specific component, use the <varname>for</varname> attribute to reference the component's identifier.
</para>
+ <para>
+ To show only those messages that are not attached to specific components, set <code>globalOnly="true"</code>.
+ </para>
+ <para>
+ The <sgmltag><rich:messages></sgmltag> component is automatically rendered after an Ajax request. This occurs without the use of an <sgmltag><a4j:outputPanel></sgmltag> component or a specific reference through the <varname>render</varname> attribute of the Ajax request source.
+ </para>
</section>
<section id="sect-Component_Reference-richmessages-Appearance">
<title>Appearance</title>
<para>
- The <sgmltag><rich:messages></sgmltag> component displays error messages for each validating component in the same container. The <varname>passedLabel</varname> attribute contains a message to display when there are no errors; that is, when validation for all components passes successfully. The <varname>layout</varname> attribute defines how the messages are presented: either using <literal>list</literal> for a list layout, or <literal>table</literal> for a tabular layout.
+ The <sgmltag><rich:messages></sgmltag> component displays error messages for each validating component in the same container.
</para>
<para>
- All messages use the same state icons, specified by using facets in the same way as for the <sgmltag><rich:message></sgmltag> component:
+ The <sgmltag><rich:messages></sgmltag> component can be further styled through CSS, the same as for the <sgmltag><rich:message></sgmltag> component. Refer to <xref linkend="sect-Component_Reference-richmessage-Appearance" /> for an example of message styling, and refer to <xref linkend="sect-Component_Reference-richmessages-Style_classes_and_skin_parameters" /> for a complete list of style classes for the <sgmltag><rich:message></sgmltag> component.
</para>
- <variablelist>
- <varlistentry>
- <term><literal>errorMarker</literal></term>
- <listitem>
- <para>
- Defines the icon for messages with the <literal>error</literal> severity class.
- </para>
- </listitem>
- </varlistentry>
- <varlistentry>
- <term><literal>fatalMarker</literal></term>
- <listitem>
- <para>
- Defines the icon for messages with the <literal>fatal</literal> severity class.
- </para>
- </listitem>
- </varlistentry>
- <varlistentry>
- <term><literal>infoMarker</literal></term>
- <listitem>
- <para>
- Defines the icon for messages with the <literal>info</literal> severity class.
- </para>
- </listitem>
- </varlistentry>
- <varlistentry>
- <term><literal>passedMarker</literal></term>
- <listitem>
- <para>
- Defines the icon for messages that are not of the <literal>error</literal>, <literal>fatal</literal>, <literal>info</literal>, or <literal>warn</literal> severity classes.
- </para>
- </listitem>
- </varlistentry>
- <varlistentry>
- <term><literal>warnMarker</literal></term>
- <listitem>
- <para>
- Defines the icon for messages with the <literal>warn</literal> severity class.
- </para>
- </listitem>
- </varlistentry>
- </variablelist>
- <example id="exam-Component_Reference-richmessages-richmessages_example">
- <title>rich:messages example</title>
- <programlisting language="XML" role="XML"><xi:include href="extras/exam-Component_Reference-richmessages-richmessages_example.xml_sample" parse="text" xmlns:xi="http://www.w3.org/2001/XInclude" />
- </programlisting>
- </example>
</section>
<section id="sect-Component_Reference-richmessages-Reference_data">
@@ -251,9 +180,7 @@
<section id="sect-Component_Reference-richmessages-Style_classes_and_skin_parameters">
<title>Style classes and skin parameters</title>
- <para>
- The <sgmltag><rich:messages></sgmltag> component uses the same styling as the <sgmltag><rich:message></sgmltag> component. Refer to <xref linkend="sect-Component_Reference-richmessage-Style_classes_and_skin_parameters" /> for details.
- </para>
+ <xi:include href="skinning/tabl-richmessages.xml" xmlns:xi="http://www.w3.org/2001/XInclude" />
</section>
</section>
@@ -290,7 +217,7 @@
<section id="sect-Component_Reference-richprogressBar-Basic_usage">
<title>Basic usage</title>
<para>
- Basic usage of the <sgmltag><rich:progressBar></sgmltag> component requires only the <varname>value</varname> attribute, which points to the method that provides the current progress.
+ Basic usage of the <sgmltag><rich:progressBar></sgmltag> component requires the <varname>value</varname> attribute, which points to the property that holds the current progress value. When the value is greater than or equal to the minimum value (<literal>0</literal> by default), the progress bar becomes active, and starts sending Ajax requests if in <literal>ajax</literal> mode.
</para>
<example id="exam-Component_Reference-richprogressBar-Basic_usage">
<title>Basic usage</title>
@@ -332,6 +259,7 @@
</listitem>
</varlistentry>
</variablelist>
+ <!--
<note>
<title>Macro-substitution</title>
<para>
@@ -378,26 +306,16 @@
<title>Using the <varname>param</varname> parameter</title>
<programlisting language="XML" role="XML"><xi:include parse="text" href="extras/exam-Component_Reference-richprogressBar-Using_the_param_parameter.xml_sample" xmlns:xi="http://www.w3.org/2001/XInclude" /></programlisting>
</example>
+ -->
<para>
- To define customized initial and complete states for the progress bar, use the <literal>initial</literal> and <literal>complete</literal> facets. The <literal>initial</literal> facet displays when the progress value is less than or equal to the minimum value, and the <literal>complete</literal> facet displays when the progress value is greater than or equal to the maximum value.
+ Define the <literal>initial</literal> and <literal>finish</literal> facets to customize the progress bar's appearance before progress has started and after progress has finished. When the current progress bar value is less than the minimum value, the <literal>initial</literal> facet is displayed. When the current progress bar is greater than the maximum value, the <literal>finish</literal> facet is displayed.
</para>
<example id="exam-Component_Reference-richprogressBar-Initial_and_complete_states">
- <title>Initial and complete states</title>
+ <title>Initial and finished states</title>
<programlisting language="XML" role="XML"><xi:include parse="text" href="extras/exam-Component_Reference-richprogressBar-Initial_and_complete_states.xml_sample" xmlns:xi="http://www.w3.org/2001/XInclude" /></programlisting>
</example>
</section>
- <section id="sect-Component_Reference-richprogressBar-Using_set_intervals">
- <title>Using set intervals</title>
- <para>
- The <sgmltag><rich:progressBar></sgmltag> component can be set to constantly poll for updates at a constant interval. Use the <varname>interval</varname> component to set the interval in milliseconds. The progress bar is updated whenever the polled value changes. Polling is only active when the <varname>enabled</varname> attribute is set to <literal>true</literal>.
- </para>
- <example id="exam-Component_Reference-richprogressBar-Using_set_intervals">
- <title>Using set intervals</title>
- <programlisting language="XML" role="XML"><xi:include parse="text" href="extras/exam-Component_Reference-richprogressBar-Using_set_intervals.xml_sample" xmlns:xi="http://www.w3.org/2001/XInclude" /></programlisting>
- </example>
- </section>
-
<section id="sect-Component_Reference-richprogressBar-Update_mode">
<title>Update mode</title>
<para>
@@ -416,13 +334,24 @@
<term><literal>client</literal></term>
<listitem>
<para>
- The progress bar updates on the client side, set using the JavaScript API.
+ The progress bar must be explicitly updated on the client side through the JavaScript API.
</para>
</listitem>
</varlistentry>
</variablelist>
</section>
+ <section id="sect-Component_Reference-richprogressBar-Using_set_intervals">
+ <title>Using set intervals</title>
+ <para>
+ The <sgmltag><rich:progressBar></sgmltag> component can be set to constantly poll for updates at a constant interval. Use the <varname>interval</varname> component to set the interval in milliseconds. The progress bar is updated whenever the polled value changes. Polling is only active when the <varname>enabled</varname> attribute is set to <literal>true</literal>.
+ </para>
+ <example id="exam-Component_Reference-richprogressBar-Using_set_intervals">
+ <title>Using set intervals</title>
+ <programlisting language="XML" role="XML"><xi:include parse="text" href="extras/exam-Component_Reference-richprogressBar-Using_set_intervals.xml_sample" xmlns:xi="http://www.w3.org/2001/XInclude" /></programlisting>
+ </example>
+ </section>
+
<section id="sect-Component_Reference-richprogressBar-JavaScript_API">
<title>JavaScript API</title>
<para>
@@ -575,14 +504,14 @@
<section id="sect-Component_Reference-richtooltip-Attaching_the_tool-tip_to_another_component">
<title>Attaching the tool-tip to another component</title>
<para>
- If not otherwise specified, the tool-tip is attached to the parent element in which it is defined. The <varname>for</varname> attribute is used to attach the tool-tip to another component, pointing to the target component's <varname>id</varname> identifier. This allows the <sgmltag><rich:tooltip></sgmltag> component to be specified outside the target element. This approach is demonstrated in <xref linkend="exam-Component_Reference-richtooltip-Attaching_the_tool-tip" />.
+ If not otherwise specified, the tool-tip is attached to the parent element in which it is defined. The <varname>target</varname> attribute is used to attach the tool-tip to another component, pointing to the target component's <varname>id</varname> identifier. This allows the <sgmltag><rich:tooltip></sgmltag> component to be specified outside the target element. This approach is demonstrated in <xref linkend="exam-Component_Reference-richtooltip-Attaching_the_tool-tip" />.
</para>
<example id="exam-Component_Reference-richtooltip-Attaching_the_tool-tip">
<title>Attaching the tool-tip</title>
<programlisting language="XML" role="XML"><xi:include parse="text" href="extras/exam-Component_Reference-richtoolTip-Attaching_the_tool-tip.xml_sample" xmlns:xi="http://www.w3.org/2001/XInclude" /></programlisting>
</example>
<para>
- The <sgmltag><rich:tooltip></sgmltag> component can alternatively be left unattached, and is instead invoked through an event handler on the target component. To leave the <sgmltag><rich:tooltip></sgmltag> component unattached, set <code>attached="false"</code>, and define the event handler to trigger the tool-tip on the target component. This approach is demonstrated in <xref linkend="exam-Component_Reference-richtooltip-Unattached_tool-tips" />. When leaving the <sgmltag><rich:tooltip></sgmltag> component unattached, ensure it has an <varname>id</varname> identifier defined. If the <sgmltag><rich:tooltip></sgmltag> component is nested inside the target element, it must be the last child. If it is defined outside the target element, it must be nested in an <sgmltag><a4j:form></sgmltag> component.
+ The <sgmltag><rich:tooltip></sgmltag> component can alternatively be left unattached, and is instead invoked through an event handler on the target component. To leave the <sgmltag><rich:tooltip></sgmltag> component unattached, set <code>attached="false"</code>, and define the event handler to trigger the tool-tip on the target component. This approach is demonstrated in <xref linkend="exam-Component_Reference-richtooltip-Unattached_tool-tips" />. When leaving the <sgmltag><rich:tooltip></sgmltag> component unattached, ensure it has an <varname>id</varname> identifier defined. If it is defined outside the target element, it must be nested in an <sgmltag><a4j:form></sgmltag> component.
</para>
<example id="exam-Component_Reference-richtooltip-Unattached_tool-tips">
<title>Unattached tool-tips</title>
@@ -593,10 +522,10 @@
<section id="sect-Component_Reference-richtooltip-Appearance">
<title>Appearance</title>
<para>
- By default, the <sgmltag><rich:tooltip></sgmltag> component is positioned intelligently based on the position of the mouse cursor. Use the <varname>direction</varname> attribute to specify a corner of the target component at which to display the tool-tip instead. Possible values include <literal>top-left</literal>, <literal>top-right</literal>, <literal>bottom-left</literal>, and <literal>bottom-right</literal>. Use the <varname>horizontalOffset</varname> and <varname>verticalOffset</varname> attributes to specify the horizontal offset and vertical offset at which to display the tool-tip.
+ By default, the <sgmltag><rich:tooltip></sgmltag> component is positioned intelligently based on the position of the mouse cursor. Use the <varname>jointPoint</varname> attribute to specify a corner of the target component at which to display the tool-tip instead, and use the <varname>direction</varname> attribute to specify the direction the tool-tip will appear relative to that corner. Possible values for both attributes are <literal>top-left</literal>, <literal>top-right</literal>, <literal>bottom-left</literal>, and <literal>bottom-right</literal>. Use the <varname>horizontalOffset</varname> and <varname>verticalOffset</varname> attributes to specify the horizontal offset and vertical offset at which to display the tool-tip.
</para>
<para>
- Use the <varname>hideEvent</varname> attribute to specify when the tool-tip is hidden. The default value is <literal>none</literal>, so the tool-tip remains shown. However, it can be linked to an event on the target component, such as the <literal>mouseout</literal> event.
+ Use the <varname>showEvent</varname> attribute to specify when the tool-tip is shown. By default it appears when the attached component is hovered-over with the mouse. Use the <varname>hideEvent</varname> attribute to specify when the tool-tip is hidden. The default value is <literal>none</literal>, so the tool-tip remains shown. However, it can be linked to an event on the target component, such as the <literal>mouseout</literal> event.
</para>
<para>
Set <code>followMouse="true"</code> to cause the tool-tip to follow the user's mouse movements.
@@ -726,7 +655,7 @@
</listitem>
</varlistentry>
<varlistentry>
- <term><function>hide(event)</function></term>
+ <term><function>hide()</function></term>
<listitem>
<para>
Hide the tool-tip.
Added: modules/docs/trunk/Component_Reference/src/main/docbook/en-US/extras/exam-Component_Reference-richmessage-Message_icons.css
===================================================================
--- modules/docs/trunk/Component_Reference/src/main/docbook/en-US/extras/exam-Component_Reference-richmessage-Message_icons.css (rev 0)
+++ modules/docs/trunk/Component_Reference/src/main/docbook/en-US/extras/exam-Component_Reference-richmessage-Message_icons.css 2011-04-05 07:32:40 UTC (rev 22366)
@@ -0,0 +1,3 @@
+.rf-msg-err{
+ background-image: url('#{facesContext.externalContext.requestContextPath}/images/icons/error.gif');
+}
Modified: modules/docs/trunk/Component_Reference/src/main/docbook/en-US/extras/exam-Component_Reference-richmessage-richmessage_example.xml_sample
===================================================================
--- modules/docs/trunk/Component_Reference/src/main/docbook/en-US/extras/exam-Component_Reference-richmessage-richmessage_example.xml_sample 2011-04-05 00:21:23 UTC (rev 22365)
+++ modules/docs/trunk/Component_Reference/src/main/docbook/en-US/extras/exam-Component_Reference-richmessage-richmessage_example.xml_sample 2011-04-05 07:32:40 UTC (rev 22366)
@@ -1,8 +1,6 @@
-<rich:message for="id" passedLabel="No errors" showSummary="true">
- <f:facet name="errorMarker">
- <h:graphicImage url="/image/error.png"/>
- </f:facet>
- <f:facet name="passedMarker">
- <h:graphicImage url="/image/passed.png"/>
- </f:facet>
-</rich:message>
+<h:outputText value="Zip:" />
+<h:inputText label="Zip" id="zip" required="true"
+ value="#{userBean.zip}">
+ <f:validateLength minimum="4" maximum="9" />
+</h:inputText>
+<rich:message for="zip" ajaxRendered="true"/>
Modified: modules/docs/trunk/Component_Reference/src/main/docbook/en-US/extras/exam-Component_Reference-richprogressBar-Initial_and_complete_states.xml_sample
===================================================================
--- modules/docs/trunk/Component_Reference/src/main/docbook/en-US/extras/exam-Component_Reference-richprogressBar-Initial_and_complete_states.xml_sample 2011-04-05 00:21:23 UTC (rev 22365)
+++ modules/docs/trunk/Component_Reference/src/main/docbook/en-US/extras/exam-Component_Reference-richprogressBar-Initial_and_complete_states.xml_sample 2011-04-05 07:32:40 UTC (rev 22366)
@@ -1,8 +1,8 @@
<rich:progressBar value="#{bean.incValue1}">
<f:facet name="initial">
- <h:outputText value="Process not started"/>
+ <h:outputText value="Process has not started"/>
</f:facet>
- <f:facet name="complete">
- <h:outputText value="Process completed"/>
+ <f:facet name="finish">
+ <h:outputText value="Process has completed"/>
</f:facet>
</rich:progressBar>
Modified: modules/docs/trunk/Component_Reference/src/main/docbook/en-US/extras/exam-Component_Reference-richprogressBar-Using_nested_child_components.xml_sample
===================================================================
--- modules/docs/trunk/Component_Reference/src/main/docbook/en-US/extras/exam-Component_Reference-richprogressBar-Using_nested_child_components.xml_sample 2011-04-05 00:21:23 UTC (rev 22365)
+++ modules/docs/trunk/Component_Reference/src/main/docbook/en-US/extras/exam-Component_Reference-richprogressBar-Using_nested_child_components.xml_sample 2011-04-05 07:32:40 UTC (rev 22366)
@@ -1,3 +1,3 @@
<rich:progressBar value="#{bean.incValue}">
- <h:outputText value="#{bean.incValue} %"/>
+ <h:outputText value="#{bean.incValue} % complete"/>
</rich:progressBar>
Modified: modules/docs/trunk/Component_Reference/src/main/docbook/en-US/extras/exam-Component_Reference-richprogressBar-Using_the_label_attribute.xml_sample
===================================================================
--- modules/docs/trunk/Component_Reference/src/main/docbook/en-US/extras/exam-Component_Reference-richprogressBar-Using_the_label_attribute.xml_sample 2011-04-05 00:21:23 UTC (rev 22365)
+++ modules/docs/trunk/Component_Reference/src/main/docbook/en-US/extras/exam-Component_Reference-richprogressBar-Using_the_label_attribute.xml_sample 2011-04-05 07:32:40 UTC (rev 22366)
@@ -1 +1 @@
-<rich:progressBar value="#{bean.incValue}" id="progrs" label="#{bean.incValue}"/>
+<rich:progressBar value="#{bean.incValue}" id="progrs" label="#{bean.incValue} % complete"/>
Modified: modules/docs/trunk/Component_Reference/src/main/docbook/en-US/extras/exam-Component_Reference-richtoolTip-Attaching_the_tool-tip.xml_sample
===================================================================
--- modules/docs/trunk/Component_Reference/src/main/docbook/en-US/extras/exam-Component_Reference-richtoolTip-Attaching_the_tool-tip.xml_sample 2011-04-05 00:21:23 UTC (rev 22365)
+++ modules/docs/trunk/Component_Reference/src/main/docbook/en-US/extras/exam-Component_Reference-richtoolTip-Attaching_the_tool-tip.xml_sample 2011-04-05 07:32:40 UTC (rev 22366)
@@ -2,4 +2,4 @@
...
</rich:panel>
-<rich:toolTip value="This is a tool-tip." for="panelId"/>
+<rich:toolTip value="This is a tool-tip." target="panelId"/>
Added: modules/docs/trunk/Component_Reference/src/main/docbook/en-US/skinning/tabl-richmessages.xml
===================================================================
--- modules/docs/trunk/Component_Reference/src/main/docbook/en-US/skinning/tabl-richmessages.xml (rev 0)
+++ modules/docs/trunk/Component_Reference/src/main/docbook/en-US/skinning/tabl-richmessages.xml 2011-04-05 07:32:40 UTC (rev 22366)
@@ -0,0 +1,146 @@
+<?xml version='1.0' encoding='utf-8' ?>
+<!DOCTYPE table PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN" "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" [
+]>
+
+<table id="tabl-richmessages-Style_classes_and_corresponding_skin_parameters">
+ <title>Style classes (selectors) and corresponding skin parameters</title>
+ <tgroup cols="3">
+ <colspec colname="class"/>
+ <colspec colname="skin"/>
+ <colspec colname="css"/>
+ <spanspec spanname="noskin" namest="skin" nameend="css"/>
+ <thead>
+ <row>
+ <entry>Class (selector)</entry>
+ <entry>Skin Parameters</entry>
+ <entry>Mapped <acronym>CSS</acronym> properties</entry>
+ </row>
+ </thead>
+ <tbody>
+
+ <row>
+ <entry morerows="1">
+ <variablelist>
+ <varlistentry>
+ <term><classname>.rf-msgs</classname></term>
+ <listitem>
+ <para>
+ This class defines styles for the message itself.
+ </para>
+ </listitem>
+ </varlistentry>
+ </variablelist>
+ </entry>
+ <entry><para><parameter>generalFamilyFont</parameter></para></entry>
+ <entry><para><property>font-family</property></para></entry>
+ </row>
+ <row>
+ <entry><para><parameter>generalSizeFont</parameter></para></entry>
+ <entry><para><property>font-size</property></para></entry>
+ </row>
+
+ <row>
+ <entry>
+ <variablelist>
+ <varlistentry>
+ <term><classname>.rf-msgs-err</classname></term>
+ <listitem>
+ <para>
+ This class defines styles for an error message.
+ </para>
+ </listitem>
+ </varlistentry>
+ </variablelist>
+ </entry>
+ <entry><para><parameter>errorColor</parameter></para></entry>
+ <entry><para><property>color</property></para></entry>
+ </row>
+
+ <row>
+ <entry>
+ <variablelist>
+ <varlistentry>
+ <term><classname>.rf-msgs-ftl</classname></term>
+ <listitem>
+ <para>
+ This class defines styles for a fatal message.
+ </para>
+ </listitem>
+ </varlistentry>
+ </variablelist>
+ </entry>
+ <entry><para><parameter>errorColor</parameter></para></entry>
+ <entry><para><property>color</property></para></entry>
+ </row>
+
+ <row>
+ <entry>
+ <variablelist>
+ <varlistentry>
+ <term><classname>.rf-msgs-inf</classname></term>
+ <listitem>
+ <para>
+ This class defines styles for an information message.
+ </para>
+ </listitem>
+ </varlistentry>
+ </variablelist>
+ </entry>
+ <entry><para><parameter>generalTextColor</parameter></para></entry>
+ <entry><para><property>color</property></para></entry>
+ </row>
+
+ <row>
+ <entry>
+ <variablelist>
+ <varlistentry>
+ <term><classname>.rf-msgs-wrn</classname></term>
+ <listitem>
+ <para>
+ This class defines styles for a warning message.
+ </para>
+ </listitem>
+ </varlistentry>
+ </variablelist>
+ </entry>
+ <entry><para><parameter>warningTextColor</parameter></para></entry>
+ <entry><para><property>color</property></para></entry>
+ </row>
+
+ <row>
+ <entry>
+ <variablelist>
+ <varlistentry>
+ <term><classname>.rf-msgs-ok</classname></term>
+ <listitem>
+ <para>
+ This class defines styles for a basic <guilabel>OK</guilabel> message.
+ </para>
+ </listitem>
+ </varlistentry>
+ </variablelist>
+ </entry>
+ <entry><para><parameter>generalTextColor</parameter></para></entry>
+ <entry><para><property>color</property></para></entry>
+ </row>
+
+ <row>
+ <entry>
+ <variablelist>
+ <varlistentry>
+ <term><classname>.rf-msgs-sum</classname></term>
+ <term><classname>.rf-msgs-det</classname></term>
+ <listitem>
+ <para>
+ These classes define styles for the summary or details of a message.
+ </para>
+ </listitem>
+ </varlistentry>
+ </variablelist>
+ </entry>
+ <entry spanname="noskin">No skin parameters.</entry>
+ </row>
+
+ </tbody>
+ </tgroup>
+</table>
Modified: modules/docs/trunk/Component_Reference/src/main/docbook/en-US/skinning/vlst-richdragIndicator.xml
===================================================================
--- modules/docs/trunk/Component_Reference/src/main/docbook/en-US/skinning/vlst-richdragIndicator.xml 2011-04-05 00:21:23 UTC (rev 22365)
+++ modules/docs/trunk/Component_Reference/src/main/docbook/en-US/skinning/vlst-richdragIndicator.xml 2011-04-05 07:32:40 UTC (rev 22366)
@@ -15,28 +15,28 @@
</varlistentry>
<varlistentry>
- <term>.rf-ind-drag</term>
+ <term>.rf-ind-drag.accept</term>
<listitem>
<para>
- This class defines styles for the indicator when it is being dragged.
+ This class defines styles for the indicator when it is over an acceptable drop target.
</para>
</listitem>
</varlistentry>
<varlistentry>
- <term>.rf-ind-acpt</term>
+ <term>.rf-ind-drag.reject</term>
<listitem>
<para>
- This class defines styles for the indicator when it is over an acceptable drop target.
+ This class defines styles for the indicator when it is over an unacceptable drop target.
</para>
</listitem>
</varlistentry>
<varlistentry>
- <term>.rf-ind-rejt</term>
+ <term>.rf-ind-drag.default</term>
<listitem>
<para>
- This class defines styles for the indicator when it is over an unacceptable drop target.
+ This class defines styles for the indicator when it is being dragged, and is not over any drop targets.
</para>
</listitem>
</varlistentry>
13 years, 1 month
JBoss Rich Faces SVN: r22365 - in modules/docs/trunk/Component_Reference/src/main/docbook/en-US: extras and 1 other directory.
by richfaces-svn-commits@lists.jboss.org
Author: SeanRogers
Date: 2011-04-04 20:21:23 -0400 (Mon, 04 Apr 2011)
New Revision: 22365
Added:
modules/docs/trunk/Component_Reference/src/main/docbook/en-US/extras/exam-Component_Reference-richtreeNode-Basic_usage.xml_sample
Modified:
modules/docs/trunk/Component_Reference/src/main/docbook/en-US/chap-Component_Reference-Menus_and_toolbars.xml
modules/docs/trunk/Component_Reference/src/main/docbook/en-US/chap-Component_Reference-Trees.xml
Log:
Completed part 3 of revisions for Engineering review: RFPL-1380
Modified: modules/docs/trunk/Component_Reference/src/main/docbook/en-US/chap-Component_Reference-Menus_and_toolbars.xml
===================================================================
--- modules/docs/trunk/Component_Reference/src/main/docbook/en-US/chap-Component_Reference-Menus_and_toolbars.xml 2011-04-04 16:12:14 UTC (rev 22364)
+++ modules/docs/trunk/Component_Reference/src/main/docbook/en-US/chap-Component_Reference-Menus_and_toolbars.xml 2011-04-05 00:21:23 UTC (rev 22365)
@@ -103,7 +103,7 @@
<section id="sect-Component_Reference-richdropDownMenu-Expanding_and_collapsing_the_menu">
<title>Expanding and collapsing the menu</title>
<para>
- By default, the menu drops down when the title is clicked. To drop down with a different event, use the <varname>eventShow</varname> attribute to define the event instead.
+ By default, the menu drops down when the title is clicked. To drop down with a different event, use the <varname>showEvent</varname> attribute to define the event instead.
</para>
<para>
Menus can be navigated using the keyboard. Additionally, menus can be navigated programmatically using the JavaScript <acronym>API</acronym>. The JavaScript API allows the following methods:
@@ -310,7 +310,7 @@
<section id="sect-Component_Reference-richmenuGroup-Basic_usage">
<title>Basic usage</title>
<para>
- The <sgmltag><rich:menuGroup></sgmltag> component requires the <varname>value</varname> attribute for basic usage. The <varname>value</varname> attribute is the text label for the menu item.
+ The <sgmltag><rich:menuGroup></sgmltag> component requires the <varname>label</varname> attribute for basic usage. The <varname>label</varname> attribute is the text label for the menu item. Alternatively, use the <literal>label</literal> facet to define content for the label.
</para>
<para>
Additionally, the <sgmltag><rich:menuGroup></sgmltag> component must contain child <sgmltag><rich:menuItem></sgmltag> components or <sgmltag><rich:menuGroup></sgmltag> components.
@@ -811,14 +811,14 @@
<section id="sect-Component_Reference-richpanelMenuGroup-Submission_modes">
<title>Submission modes</title>
<para>
- If the <varname>mode</varname> attribute is unspecified, the submission behavior for the group is inherited from the parent <sgmltag><rich:panelMenu></sgmltag>. Otherwise, the <varname>mode</varname> setting is used instead of the parent's behavior. Refer to <xref linkend="sect-Component_Reference-richpanelMenu-Submission_modes" /> for submission mode settings.
+ If the <varname>mode</varname> attribute is unspecified, the submission behavior for the group is inherited from the parent <sgmltag><rich:panelMenu></sgmltag>. Otherwise, the <varname>groupMode</varname> setting of the panel menu is used instead of the parent's behavior. Refer to <xref linkend="sect-Component_Reference-richpanelMenu-Submission_modes" /> for submission mode settings.
</para>
</section>
<section id="sect-Component_Reference-richpanelMenuGroup-richpanelMenuGroup_server-side_events">
<title><sgmltag><rich:panelMenuGroup></sgmltag> server-side events</title>
<para>
- The <sgmltag><rich:panelMenuGroup></sgmltag> component fires the <literal>ActionEvent</literal> event on the server side when the menu group receives a user action. The event only fires in the <literal>server</literal> and <literal>ajax</literal> submission modes. The event provides the <varname>action</varname> attribute to specify the user action performed, and the <varname>actionListener</varname> attribute to reference the event listener.
+ The <sgmltag><rich:panelMenuGroup></sgmltag> component fires the <literal>ActionEvent</literal> event on the server side when the menu group receives a user action. The event only fires in the <literal>server</literal> and <literal>ajax</literal> submission modes. The event provides the <varname>action</varname> attribute to specify the user action method, and the <varname>actionListener</varname> attribute to reference the event listener.
</para>
</section>
@@ -956,7 +956,7 @@
<section id="sect-Component_Reference-richpanelMenuItem-Submission_modes">
<title>Submission modes</title>
<para>
- If the <varname>mode</varname> is unspecified, the submission behavior for the item is inherited from the parent <sgmltag><rich:panelMenu></sgmltag>. Otherwise, the <varname>mode</varname> setting is used instead of the parent's behavior.
+ If the <varname>mode</varname> is unspecified, the submission behavior for the item is inherited from the parent <sgmltag><rich:panelMenu></sgmltag>. Otherwise, the <varname>itemMode</varname> setting from the panel menu is used instead of the parent's behavior.
</para>
</section>
Modified: modules/docs/trunk/Component_Reference/src/main/docbook/en-US/chap-Component_Reference-Trees.xml
===================================================================
--- modules/docs/trunk/Component_Reference/src/main/docbook/en-US/chap-Component_Reference-Trees.xml 2011-04-04 16:12:14 UTC (rev 22364)
+++ modules/docs/trunk/Component_Reference/src/main/docbook/en-US/chap-Component_Reference-Trees.xml 2011-04-05 00:21:23 UTC (rev 22365)
@@ -122,7 +122,7 @@
<term><literal>server</literal></term>
<listitem>
<para>
- The <sgmltag><rich:tree></sgmltag> component performs a common submission, completely re-rendering the page.
+ The <sgmltag><rich:tree></sgmltag> component performs a common submission, completely refreshing the page.
</para>
</listitem>
</varlistentry>
@@ -130,13 +130,13 @@
<term><literal>client</literal></term>
<listitem>
<para>
- The <sgmltag><rich:tree></sgmltag> component updates on the client side, re-rendering itself and any additional components listed with the <varname>render</varname> attribute.
+ The <sgmltag><rich:tree></sgmltag> component updates on the client side through JavaScript, without any additional requests or updates. All nodes are rendered to the client during the initial page rendering.
</para>
</listitem>
</varlistentry>
</variablelist>
<para>
- By default, the event to expand or collapse a tree node is a mouse click. To specify a different event, use the <varname>toggleNodeEvent</varname> attribute.
+ By default, tree nodes are expanded and collapsed through the <guibutton>+</guibutton> and <guibutton>-</guibutton> controls. To expand or collapse a tree node using an action event such as a mouse click, specify the event with the <varname>toggleNodeEvent</varname> attribute.
</para>
</section>
@@ -158,7 +158,7 @@
<term><literal>server</literal></term>
<listitem>
<para>
- The <sgmltag><rich:tree></sgmltag> component performs a common submission, completely re-rendering the page.
+ The <sgmltag><rich:tree></sgmltag> component performs a common submission, completely refreshing the page.
</para>
</listitem>
</varlistentry>
@@ -166,7 +166,7 @@
<term><literal>client</literal></term>
<listitem>
<para>
- The <sgmltag><rich:tree></sgmltag> component updates on the client side, re-rendering itself and any additional components listed with the <varname>render</varname> attribute.
+ The <sgmltag><rich:tree></sgmltag> component updates on the client side using JavaScript, without any additional requests or updates.
</para>
</listitem>
</varlistentry>
@@ -363,8 +363,15 @@
<section id="sect-Component_Reference-richtreeNode-Basic_usage">
<title>Basic usage</title>
<para>
- The <sgmltag><rich:treeNode></sgmltag> component must be a child of a <sgmltag><rich:tree></sgmltag> component. It does not need any attributes declared for basic usage, but can provide markup templates for tree nodes of particular types. Refer to <xref linkend="exam-Component_Reference-richtree-Basic_usage" /> for an example of basic <sgmltag><rich:treeNode></sgmltag> component usage.
+ The <sgmltag><rich:treeNode></sgmltag> component must be a child of a <sgmltag><rich:tree></sgmltag> component or a tree adaptor component. It does not need any attributes declared for basic usage, but can provide markup templates for tree nodes of particular types. Default markup is used if the tree node type is not specified. Refer to <xref linkend="exam-Component_Reference-richtree-Basic_usage" /> for an example of basic <sgmltag><rich:treeNode></sgmltag> component usage.
</para>
+ <example id="exam-Component_Reference-richtreeNode-Basic_usage">
+ <title>Basic usage</title>
+ <programlisting language="XML" role="XML"><xi:include parse="text" href="extras/exam-Component_Reference-richtreeNode-Basic_usage.xml_sample" xmlns:xi="http://www.w3.org/2001/XInclude" /></programlisting>
+ <para>
+ The example renders a simple tree of countries. Each country node expands to show state nodes for that country, and each state node expands to show city nodes for that state.
+ </para>
+ </example>
</section>
<section id="sect-Component_Reference-richtreeNode-Appearance">
@@ -373,8 +380,9 @@
Refer to <xref linkend="sect-Component_Reference-richtree-Appearance" /> for the <sgmltag><rich:tree></sgmltag> component for details and examples on styling nodes and icons. Icon styling for individual <sgmltag><rich:treeNode></sgmltag> components uses the same attributes as the parent <sgmltag><rich:tree></sgmltag> component: <varname>iconLeaf</varname>, <varname>iconExpanded</varname>, and <varname>iconCollapsed</varname>. Icon-related attributes specified for child <sgmltag><rich:treeNode></sgmltag> components overwrite any global icon attributes of the parent <sgmltag><rich:tree></sgmltag> component.
</para>
<para>
- Use the <varname>rendered</varname> attribute to determine whether the node should actually be rendered in the tree or not. Using the <varname>rendered</varname> attribute in combination with the <sgmltag><rich:treeNode></sgmltag> <varname>type</varname> attribute can allow further style differentiation between node content, as shown in <xref linkend="exam-Component_Reference-richtreeNode-rendered_attribute" />.
+ Use the <varname>rendered</varname> attribute to determine whether the node should actually be rendered in the tree or not. Using the <varname>rendered</varname> attribute in combination with the <sgmltag><rich:treeNode></sgmltag> <varname>type</varname> attribute can allow further style differentiation between node content.
</para>
+ <!--
<example id="exam-Component_Reference-richtreeNode-rendered_attribute">
<title><varname>rendered</varname> attribute</title>
<para>
@@ -387,6 +395,7 @@
</imageobject>
</mediaobject>
</example>
+ -->
</section>
<section id="sect-Component_Reference-richtreeNode-Interactivity">
@@ -469,7 +478,7 @@
<sgmltag><rich:treeModelAdaptor></sgmltag> components can further be nested in other <sgmltag><rich:treeModelAdaptor></sgmltag> components to subsequently populate lower levels of the tree.
</para>
<para>
- To access the current element at each iteration, use the <varname>var</varname> attribute of either the parent <sgmltag><rich:tree></sgmltag> component or the <sgmltag><rich:treeModelAdaptor></sgmltag> component itself. <xref linkend="exam-Component_Reference-richtreeModelAdaptor-Nested_richtreeModelAdaptor_components" /> demonstrates a series of nested <sgmltag><rich:treeModelAdaptor></sgmltag> components, each using the parent's <varname>var</varname> attribute to reference the current element.
+ To access the current element at each iteration, use the <varname>var</varname> attribute of either the parent <sgmltag><rich:tree></sgmltag> component<!-- or the <sgmltag><rich:treeModelAdaptor></sgmltag> component itself-->. <xref linkend="exam-Component_Reference-richtreeModelAdaptor-Nested_richtreeModelAdaptor_components" /> demonstrates a series of nested <sgmltag><rich:treeModelAdaptor></sgmltag> components, each using the parent's <varname>var</varname> attribute to reference the current element.
</para>
<example id="exam-Component_Reference-richtreeModelAdaptor-Nested_richtreeModelAdaptor_components">
<title><sgmltag>Nested <rich:treeModelAdaptor> components</sgmltag></title>
Added: modules/docs/trunk/Component_Reference/src/main/docbook/en-US/extras/exam-Component_Reference-richtreeNode-Basic_usage.xml_sample
===================================================================
--- modules/docs/trunk/Component_Reference/src/main/docbook/en-US/extras/exam-Component_Reference-richtreeNode-Basic_usage.xml_sample (rev 0)
+++ modules/docs/trunk/Component_Reference/src/main/docbook/en-US/extras/exam-Component_Reference-richtreeNode-Basic_usage.xml_sample 2011-04-05 00:21:23 UTC (rev 22365)
@@ -0,0 +1,12 @@
+<rich:tree nodeType="#{node.type}" var="node"
+ value="#{treeBean.rootNodes}">
+ <rich:treeNode type="country">
+ #{node.name}
+ </rich:treeNode>
+ <rich:treeNode type="state">
+ #{node.name}
+ </rich:treeNode>
+ <rich:treeNode type="city">
+ #{node.name}
+ </rich:treeNode>
+</rich:tree>
13 years, 1 month
JBoss Rich Faces SVN: r22364 - in modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest: richTooltip and 1 other directory.
by richfaces-svn-commits@lists.jboss.org
Author: ppitonak(a)redhat.com
Date: 2011-04-04 12:12:14 -0400 (Mon, 04 Apr 2011)
New Revision: 22364
Modified:
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/a4jQueue/TestGlobalQueue.java
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richTooltip/TestTooltipSimple.java
Log:
tests updated
Modified: modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/a4jQueue/TestGlobalQueue.java
===================================================================
--- modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/a4jQueue/TestGlobalQueue.java 2011-04-04 13:23:24 UTC (rev 22363)
+++ modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/a4jQueue/TestGlobalQueue.java 2011-04-04 16:12:14 UTC (rev 22364)
@@ -24,6 +24,8 @@
import static org.jboss.test.selenium.utils.URLUtils.buildUrl;
import static org.testng.Assert.assertEquals;
+import com.thoughtworks.selenium.SeleniumException;
+
import java.net.URL;
import org.jboss.cheiron.halt.XHRHalter;
@@ -31,11 +33,10 @@
import org.richfaces.tests.metamer.ftest.AbstractMetamerTest;
import org.richfaces.tests.metamer.ftest.annotations.Inject;
import org.richfaces.tests.metamer.ftest.annotations.IssueTracking;
+import org.richfaces.tests.metamer.ftest.annotations.RegressionTest;
import org.richfaces.tests.metamer.ftest.annotations.Use;
import org.testng.annotations.Test;
-import com.thoughtworks.selenium.SeleniumException;
-
/**
* @author <a href="mailto:lfryc@redhat.com">Lukas Fryc</a>
* @version $Revision$
@@ -110,7 +111,7 @@
* </p>
*/
@Test
- @IssueTracking("https://issues.jboss.org/browse/RFPL-1194")
+ @RegressionTest("https://issues.jboss.org/browse/RFPL-1194")
public void testMultipleRequestsWithNoDelay() {
attributes.setRequestDelay(0);
Modified: modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richTooltip/TestTooltipSimple.java
===================================================================
--- modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richTooltip/TestTooltipSimple.java 2011-04-04 13:23:24 UTC (rev 22363)
+++ modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richTooltip/TestTooltipSimple.java 2011-04-04 16:12:14 UTC (rev 22364)
@@ -64,44 +64,33 @@
private static final int EVENT_OFFSET = 10;
private static final int PRESET_OFFSET = 5;
-
TooltipAttributes attributes = new TooltipAttributes();
JQueryLocator panel = pjq("div[id$=panel]");
TooltipModel tooltip = new TooltipModel(jq(".rf-tt"), panel);
-
Point eventPosition;
-
@Inject
@Use(empty = true)
Positioning direction;
-
- Integer[] offsets = new Integer[] { 0, PRESET_OFFSET, -PRESET_OFFSET };
-
+ Integer[] offsets = new Integer[]{0, PRESET_OFFSET, -PRESET_OFFSET};
@Inject
@Use(ints = 0)
Integer verticalOffset;
-
@Inject
@Use(ints = 0)
Integer horizontalOffset;
-
@Inject
@Use(empty = true)
Event domEvent;
- Event[] domEvents = { CLICK, DBLCLICK, MOUSEDOWN, MOUSEMOVE, MOUSEOUT, MOUSEOVER, MOUSEUP };
-
+ Event[] domEvents = {CLICK, DBLCLICK, MOUSEDOWN, MOUSEMOVE, MOUSEOUT, MOUSEOVER, MOUSEUP};
@Inject
@Use(empty = true)
Boolean followMouse = true;
-
@Inject
@Use(empty = true)
Integer presetDelay;
-
@Inject
@Use(empty = true)
TooltipLayout layout;
-
@Inject
@Use(empty = true)
TooltipMode mode;
@@ -156,8 +145,10 @@
}
@Test
- @Uses({ @Use(field = "direction", enumeration = true), @Use(field = "verticalOffset", value = "offsets"),
- @Use(field = "horizontalOffset", value = "offsets") })
+ @Uses({
+ @Use(field = "direction", enumeration = true),
+ @Use(field = "verticalOffset", value = "offsets"),
+ @Use(field = "horizontalOffset", value = "offsets")})
public void testPositioning() {
attributes.setDirection(direction);
attributes.setHorizontalOffset(horizontalOffset);
@@ -179,7 +170,7 @@
break;
case LEFT:
assertEquals(tooltipPosition.getX() + tooltipDimension.getWidth(), eventPosition.getX()
- - horizontalOffset);
+ - horizontalOffset);
default:
}
}
@@ -191,14 +182,14 @@
break;
case TOP:
assertEquals(tooltipPosition.getY() + tooltipDimension.getHeight(), eventPosition.getY()
- - verticalOffset);
+ - verticalOffset);
default:
}
}
}
@Test
- @Use(field = "followMouse", booleans = { true, false })
+ @Use(field = "followMouse", booleans = {true, false})
public void testFollowMouse() {
attributes.setFollowMouse(followMouse);
@@ -217,13 +208,14 @@
}
@Test
- @Use(field = "presetDelay", ints = { 0, 1000, 5000 })
+ @Use(field = "presetDelay", ints = {0, 1000, 5000})
public void testHideDelay() {
attributes.setMode(TooltipMode.ajax);
attributes.setHideDelay(presetDelay);
new DelayTester(presetDelay) {
+
public void beforeAction() {
tooltip.recall();
}
@@ -285,7 +277,9 @@
retrieveRequestTime.initializeValue();
tooltip.recall();
- assertEquals(retrieveRequestTime.isValueChanged(), mode == TooltipMode.ajax);
+ if (mode == TooltipMode.ajax) {
+ waitGui.waitForChange(retrieveRequestTime);
+ }
retrieveRequestTime.initializeValue();
tooltip.hide();
@@ -309,7 +303,7 @@
}
@Test
- @Use(field = "presetDelay", ints = { 0, 1000, 5000 })
+ @Use(field = "presetDelay", ints = {0, 1000, 5000})
@RegressionTest("https://issues.jboss.org/browse/RF-10522")
public void testShowDelay() {
@@ -317,6 +311,7 @@
attributes.setShowDelay(presetDelay);
new DelayTester(presetDelay) {
+
public void action() {
tooltip.recall();
waitGui.timeout(presetDelay + 2000).until(isDisplayed.locator(tooltip));
@@ -374,10 +369,10 @@
final Dimension panelDimension = selenium.getElementDimension(panel);
eventPosition = new Point(panelPosition.getX() + panelDimension.getWidth() - EVENT_OFFSET, panelPosition.getY()
- + panelDimension.getHeight() - EVENT_OFFSET);
+ + panelDimension.getHeight() - EVENT_OFFSET);
tooltip.recall(panelDimension.getWidth() - EVENT_OFFSET + offsetX, panelDimension.getHeight() - EVENT_OFFSET
- + offsetY);
+ + offsetY);
}
private HorizontalAlignment getHorizontalAlignment() {
@@ -405,11 +400,12 @@
}
private enum HorizontalAlignment {
+
LEFT, RIGHT
}
private enum VerticalAlignment {
+
TOP, BOTTOM
}
-
}
13 years, 1 month
JBoss Rich Faces SVN: r22363 - in modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest: richInputNumberSlider and 1 other directory.
by richfaces-svn-commits@lists.jboss.org
Author: ppitonak(a)redhat.com
Date: 2011-04-04 09:23:24 -0400 (Mon, 04 Apr 2011)
New Revision: 22363
Modified:
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richCalendar/TestRichCalendarAttributes.java
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richInputNumberSlider/TestRichSlider.java
Log:
added issue tracking information
2 tests for calendar fixed
Modified: modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richCalendar/TestRichCalendarAttributes.java
===================================================================
--- modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richCalendar/TestRichCalendarAttributes.java 2011-04-04 13:22:52 UTC (rev 22362)
+++ modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richCalendar/TestRichCalendarAttributes.java 2011-04-04 13:23:24 UTC (rev 22363)
@@ -108,7 +108,7 @@
assertNoDateSelected();
// the most top-left column might be 1st day of month
- while (selenium.getText(cellWeekDay.format(1, 0)).equals("1")) {
+ while (selenium.getText(cellWeekDay.format(1, 1)).equals("1")) {
selenium.click(prevMonthButton);
}
@@ -142,7 +142,7 @@
assertSelected(selectedDate);
// the most top-left column might be 1st day of month
- while (selenium.getText(cellWeekDay.format(1, 0)).equals("1")) {
+ while (selenium.getText(cellWeekDay.format(1, 1)).equals("1")) {
selenium.click(prevMonthButton);
}
@@ -375,6 +375,7 @@
}
@Test
+ @IssueTracking("https://issues.jboss.org/browse/RF-10821")
public void testImmediate() {
selenium.click(pjq("input[name$=immediateInput][value=true]"));
selenium.waitForPageToLoad();
Modified: modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richInputNumberSlider/TestRichSlider.java
===================================================================
--- modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richInputNumberSlider/TestRichSlider.java 2011-04-04 13:22:52 UTC (rev 22362)
+++ modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richInputNumberSlider/TestRichSlider.java 2011-04-04 13:23:24 UTC (rev 22363)
@@ -410,6 +410,7 @@
}
@Test
+ @IssueTracking("https://issues.jboss.org/browse/RF-10829")
public void testOnblur() {
testFireEvent(Event.BLUR, slider);
}
@@ -467,6 +468,7 @@
}
@Test
+ @IssueTracking("https://issues.jboss.org/browse/RF-10829")
public void testOnfocus() {
testFireEvent(Event.FOCUS, slider);
}
@@ -512,6 +514,7 @@
}
@Test
+ @IssueTracking("https://issues.jboss.org/browse/RF-10829")
public void testOnselect() {
testFireEvent(Event.SELECT, slider);
}
13 years, 1 month
JBoss Rich Faces SVN: r22362 - modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richPanelMenuItem.
by richfaces-svn-commits@lists.jboss.org
Author: ppitonak(a)redhat.com
Date: 2011-04-04 09:22:52 -0400 (Mon, 04 Apr 2011)
New Revision: 22362
Modified:
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richPanelMenuItem/TestPanelMenuItemClientSideHandlers.java
Log:
issue tracking info added
Modified: modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richPanelMenuItem/TestPanelMenuItemClientSideHandlers.java
===================================================================
--- modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richPanelMenuItem/TestPanelMenuItemClientSideHandlers.java 2011-04-04 13:22:23 UTC (rev 22361)
+++ modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richPanelMenuItem/TestPanelMenuItemClientSideHandlers.java 2011-04-04 13:22:52 UTC (rev 22362)
@@ -30,6 +30,7 @@
import org.richfaces.tests.metamer.ftest.AbstractMetamerTest;
import org.richfaces.tests.metamer.ftest.annotations.Inject;
+import org.richfaces.tests.metamer.ftest.annotations.IssueTracking;
import org.richfaces.tests.metamer.ftest.annotations.RegressionTest;
import org.richfaces.tests.metamer.ftest.annotations.Use;
import org.richfaces.tests.metamer.ftest.model.PanelMenu;
@@ -87,6 +88,7 @@
}
@Test
+ @IssueTracking("https://issues.jboss.org/browse/RF-10844")
public void testClientSideEventsOrderServer() {
attributes.setMode(server);
menu.setItemMode(server);
13 years, 1 month
JBoss Rich Faces SVN: r22361 - modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richPanelMenuGroup.
by richfaces-svn-commits@lists.jboss.org
Author: ppitonak(a)redhat.com
Date: 2011-04-04 09:22:23 -0400 (Mon, 04 Apr 2011)
New Revision: 22361
Modified:
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richPanelMenuGroup/TestPanelMenuGroupClientSideHandlers.java
Log:
tests for panel menu group fixed
Modified: modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richPanelMenuGroup/TestPanelMenuGroupClientSideHandlers.java
===================================================================
--- modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richPanelMenuGroup/TestPanelMenuGroupClientSideHandlers.java 2011-04-04 11:11:37 UTC (rev 22360)
+++ modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richPanelMenuGroup/TestPanelMenuGroupClientSideHandlers.java 2011-04-04 13:22:23 UTC (rev 22361)
@@ -30,7 +30,7 @@
import org.jboss.test.selenium.encapsulated.JavaScript;
import org.richfaces.tests.metamer.ftest.annotations.Inject;
-import org.richfaces.tests.metamer.ftest.annotations.IssueTracking;
+import org.richfaces.tests.metamer.ftest.annotations.RegressionTest;
import org.richfaces.tests.metamer.ftest.annotations.Use;
import org.richfaces.tests.metamer.ftest.model.PanelMenu;
import org.testng.annotations.Test;
@@ -44,22 +44,21 @@
@Inject
@Use(empty = true)
String event;
- String[] ajaxExpansionEvents = new String[] { "beforeselect", "beforeswitch", "beforeexpand", "begin",
- "beforedomupdate", "select", "expand", "switch", "complete" };
- String[] ajaxCollapsionEvents = new String[] { "beforeselect", "beforeswitch", "beforecollapse", "begin",
- "beforedomupdate", "select", "collapse", "switch", "complete" };
- String[] clientExpansionEvents = new String[] { "beforeselect", "beforeswitch", "beforeexpand", "select", "expand",
- "switch" };
- String[] clientCollapsionEvents = new String[] { "beforeselect", "beforeswitch", "beforecollapse", "select",
- "collapse", "switch" };
- String[] serverExpansionEvents = new String[] { "beforeswitch", "beforeexpand" };
- String[] serverCollapsionEvents = new String[] { "beforeswitch", "beforecollapse" };
+ String[] ajaxExpansionEvents = new String[]{"beforeselect", "beforeswitch", "beforeexpand", "begin",
+ "beforedomupdate", "select", "expand", "switch", "complete"};
+ String[] ajaxCollapsionEvents = new String[]{"beforeselect", "beforeswitch", "beforecollapse", "begin",
+ "beforedomupdate", "select", "collapse", "switch", "complete"};
+ String[] clientExpansionEvents = new String[]{"beforeselect", "beforeswitch", "beforeexpand", "select", "expand",
+ "switch"};
+ String[] clientCollapsionEvents = new String[]{"beforeselect", "beforeswitch", "beforecollapse", "select",
+ "collapse", "collapse", "switch"};
+ String[] serverExpansionEvents = new String[]{"beforeswitch", "beforeexpand"};
+ String[] serverCollapsionEvents = new String[]{"beforeswitch", "beforecollapse"};
@Override
public URL getTestUrl() {
return buildUrl(contextPath, "faces/components/richPanelMenuGroup/simple.xhtml");
}
-
PanelMenu.Group group1 = menu.getGroupContains("Group 1");
@Test
@@ -96,7 +95,7 @@
}
@Test
- @IssueTracking("https://issues.jboss.org/browse/RF-10564")
+ @RegressionTest("https://issues.jboss.org/browse/RF-10564")
public void testClientSideCollapsionEventsOrderClient() {
attributes.setMode(client);
menu.setGroupMode(client);
13 years, 1 month
JBoss Rich Faces SVN: r22359 - in modules/docs/trunk/Component_Reference/src/main/docbook/en-US: extras and 1 other directory.
by richfaces-svn-commits@lists.jboss.org
Author: SeanRogers
Date: 2011-04-04 02:50:06 -0400 (Mon, 04 Apr 2011)
New Revision: 22359
Added:
modules/docs/trunk/Component_Reference/src/main/docbook/en-US/extras/exam-Component_Reference-a4jrepeat-Update_a_single_component.xml_sample
Modified:
modules/docs/trunk/Component_Reference/src/main/docbook/en-US/chap-Component_Reference-Tables_and_grids.xml
Log:
Revised Tables and Grids chapter according to Engineering review: RFPL-1380
Modified: modules/docs/trunk/Component_Reference/src/main/docbook/en-US/chap-Component_Reference-Tables_and_grids.xml
===================================================================
--- modules/docs/trunk/Component_Reference/src/main/docbook/en-US/chap-Component_Reference-Tables_and_grids.xml 2011-04-04 00:05:53 UTC (rev 22358)
+++ modules/docs/trunk/Component_Reference/src/main/docbook/en-US/chap-Component_Reference-Tables_and_grids.xml 2011-04-04 06:50:06 UTC (rev 22359)
@@ -11,8 +11,11 @@
<section id="sect-Component_Reference-Actions-a4jrepeat">
<title><sgmltag><a4j:repeat></sgmltag></title>
<para>
- The <sgmltag><a4j:repeat></sgmltag> component is used to iterate changes through a repeated collection of components. It allows specific rows of items to be updated without sending Ajax requests for the entire collection. The <sgmltag><a4j:repeat></sgmltag> component forms the basis for many of the tabular components detailed in <xref linkend="chap-Component_Reference-Tables_and_grids" />.
+ The non-visual <sgmltag><a4j:repeat></sgmltag> component is used to iterate through a data model. The component renders child content for every iteration according to the current object data.
</para>
+ <para>
+ The <sgmltag><a4j:repeat></sgmltag> component extends the standard <classname>UIRepeat</classname> component to allow partial updates within iterations while sending Ajax requests. The component acts as a base for all the data iteration components detailed in this chapter.
+ </para>
<section id="sect-Component_Reference-a4jrepeat-Basic_usage">
<title>Basic usage</title>
@@ -34,43 +37,42 @@
The <sgmltag><a4j:repeat></sgmltag> component uses other attributes common to iteration components, such as the <varname>first</varname> attribute for specifying the first item for iteration, and the <varname>rows</varname> attribute for specifying the number of rows of items to display.
</para>
<para>
- Specific cells, rows, and columns can be updated without sending Ajax requests for the entire collection. Components that cause the change can specify which part of the table to update through the <varname>render</varname> attribute. The <varname>render</varname> attribute specifies which part of a table to update:
+ Specific cells, rows, and columns can be updated without sending Ajax requests for the entire collection. Components that cause the change can specify which part of the table to update through the <varname>render</varname> attribute. The <varname>render</varname> attribute specifies which part of a table to update. The updated parts relate to where the action component is placed relative to the table:
</para>
<variablelist>
<varlistentry>
- <term><code><varname>render</varname>=<replaceable>cellId</replaceable></code></term>
+ <term>Action components inside the table</term>
<listitem>
<para>
- Update the cell with an identifier of <replaceable>cellId</replaceable> within the row that contains the current component.
+ Use <code><varname>render</varname>=<replaceable>componentID</replaceable></code> where the component identified by <replaceable>componentID</replaceable> is in the same row as the action component. The action component updates the single specified component, as demonstrated in <xref linkend="exam-Component_Reference-a4jrepeat-Update_a_single_component" />.
</para>
- <para>
- Instead of a specific identifier, the <replaceable>cellId</replaceable> reference could be a variable: <code><varname>render</varname>=#{<replaceable>bean.cellToUpdate</replaceable>}</code>.
- </para>
+ <example id="exam-Component_Reference-a4jrepeat-Update_a_single_component">
+ <title>Update a single component</title>
+ <programlisting language="XML" role="XML"><xi:include parse="text" href="extras/exam-Component_Reference-a4jrepeat-Update_a_single_component.xml_sample" xmlns:xi="http://www.w3.org/2001/XInclude" /></programlisting>
+ </example>
</listitem>
</varlistentry>
<varlistentry>
- <term><code><varname>render</varname>=<replaceable>tableId</replaceable>:<replaceable>rowId</replaceable></code></term>
+ <term>Action components outside the table</term>
<listitem>
<para>
- Update the row with an identifier of <replaceable>rowId</replaceable> within the table with an identifier of <replaceable>tableId</replaceable>. Alternatively, if the current component is contained within the table, use <code><varname>render</varname>=<replaceable>rowId</replaceable></code>.
+ Use <code><varname>render</varname>=<replaceable>tableId</replaceable>:<replaceable>rowId</replaceable>:<replaceable>cellId</replaceable></code> to specify the cell to update. The action component updates the cell with an identifier of <replaceable>cellId</replaceable>, which is within the row with an identifier of <replaceable>rowId</replaceable>, which is within the table with an identifier of <replaceable>tableId</replaceable>.
</para>
<para>
- Instead of a specific identifier, the <replaceable>tableId</replaceable> of <replaceable>rowId</replaceable> references could be variables: <code><varname>render</varname>=<replaceable>tableId</replaceable>:#{<replaceable>bean.rowToUpdate</replaceable>}</code>.
+ Instead of a specific identifier, any of the references could be variables, as demonstrated in <xref linkend="exam-Component_Reference-a4jrepeat-Use_variables_to_specify_references" />.
</para>
+ <example id="exam-Component_Reference-a4jrepeat-Use_variables_to_specify_references">
+ <title>Use variables to specify references</title>
+ <programlisting><varname>render</varname>=<replaceable>tableId</replaceable>:#{@rows(<replaceable>bean.rowToUpdate</replaceable>)}:<replaceable>cellId</replaceable></programlisting>
+ <para>
+ The <function>@rows</function> function accepts a collection of row keys to be updated.
+ </para>
+ </example>
</listitem>
</varlistentry>
- <varlistentry>
- <term><code><varname>render</varname>=<replaceable>tableId</replaceable>:<replaceable>rowId</replaceable>:<replaceable>cellId</replaceable></code></term>
- <listitem>
- <para>
- Update the cell with an identifier of <replaceable>cellId</replaceable>, within the row with and identifier of <replaceable>rowId</replaceable>, within the table with an identifier of <replaceable>tableId</replaceable>.
- </para>
- <para>
- Instead of a specific identifier, any of the references could be variables: <code><varname>render</varname>=<replaceable>tableId</replaceable>:#{<replaceable>bean.rowToUpdate</replaceable>}:<replaceable>cellId</replaceable></code>.
- </para>
- </listitem>
- </varlistentry>
</variablelist>
+
+ <!-- component specific
<para>
Alternatively, keywords can be used with the <varname>render</varname> attribute:
</para>
@@ -116,6 +118,7 @@
</listitem>
</varlistentry>
</variablelist>
+ -->
</section>
<section id="sect-Component_Reference-a4jrepeat-Reference_data">
@@ -149,12 +152,12 @@
<section id="sect-Component_Reference-Tables_and_grids-richdataTable">
<title><sgmltag><rich:dataTable></sgmltag></title>
<para>
- The <sgmltag><rich:dataTable></sgmltag> component is used to render a table, including the table's header and footer. It works in conjunction with the <sgmltag><rich:column></sgmltag> and <sgmltag><rich:columnGroup></sgmltag> components to list the contents of a data model.
+ The <sgmltag><rich:dataTable></sgmltag> component is used to render a table, including the table's caption. It works in conjunction with the <sgmltag><rich:column></sgmltag> and <sgmltag><rich:columnGroup></sgmltag> components to list the contents of a data model.
</para>
<note>
<title><sgmltag><rich:extendedDataTable></sgmltag></title>
<para>
- The <sgmltag><rich:dataTable></sgmltag> component does not include extended table features, such as data scrolling, row selection, and column reordering. These features are available as part of the <sgmltag><rich:extendedDataTable></sgmltag> component; refer to <xref linkend="sect-Component_Reference-Tables_and_grids-richextendedDataTable" /> for further details.
+ The <sgmltag><rich:dataTable></sgmltag> component does not include extended table features, such as data scrolling (including lazy Ajax loading), row selection, and column reordering. These features are available as part of the <sgmltag><rich:extendedDataTable></sgmltag> component; refer to <xref linkend="sect-Component_Reference-Tables_and_grids-richextendedDataTable" /> for further details.
</para>
</note>
@@ -163,6 +166,9 @@
<para>
The <varname>value</varname> attribute points to the data model, and the <varname>var</varname> attribute specifies a variable to use when iterating through the data model.
</para>
+ <para>
+ In addition, the table requires a set of <sgmltag><rich:column></sgmltag> components to define the content of the table.
+ </para>
</section>
<section id="sect-Component_Reference-richdataTable-Customizing_the_table">
@@ -201,6 +207,12 @@
<para>
As <sgmltag><rich:dataTable></sgmltag> the component is based on the <sgmltag><a4j:repeat></sgmltag> component, it can be partially updated with Ajax. Refer to <xref linkend="sect-Component_Reference-a4jrepeat-Limited_views_and_partial_updates" /> for details on partially updating the <sgmltag><rich:dataTable></sgmltag> component.
</para>
+ <para>
+ The <sgmltag><rich:dataTable></sgmltag> component supports master-detail markup with collapsible sub-table sections. Refer to <xref linkend="sect-Component_Reference-Tables_and_grids-richcollapsibleSubTable" /> for full details on using the <sgmltag><rich:collapsibleSubTable></sgmltag> component.
+ </para>
+ <para>
+ Use the <varname>rows</varname> attribute to specify the number of rows to show at a time. The table is then presented in pages of rows. Pages can be navigated by using a control such as the <sgmltag><rich:dataScroller></sgmltag> component. Refer to <xref linkend="sect-Component_Reference-Tables_and_grids-richdataScroller" /> for full details on using the <sgmltag><rich:dataScroller></sgmltag> component.
+ </para>
</section>
<section id="sect-Component_Reference-richdataTable-JavaScript_API">
@@ -226,7 +238,7 @@
</listitem>
</varlistentry>
<varlistentry>
- <term><function>switchSubTables()</function></term>
+ <term><function>switchSubTable(subtableId)</function></term>
<listitem>
<para>
Switch the expanded or collapsed state of any sub-tables contained in the data table.
@@ -561,8 +573,11 @@
<section id="sect-Component_Reference-Tables_and_grids-richcollapsibleSubTable">
<title><sgmltag><rich:collapsibleSubTable></sgmltag></title>
<para>
- The <sgmltag><rich:collapsibleSubTable></sgmltag> component acts as a child element to a <sgmltag><rich:dataTable></sgmltag> component. It allows sections of a table to be grouped into collapsible sections. The <sgmltag><rich:collapsibleSubTable></sgmltag> component works with the <sgmltag><rich:collapsibleSubTableToggler></sgmltag> component, which allows the user to expand and collapse the sub tables.
+ The <sgmltag><rich:collapsibleSubTable></sgmltag> component acts as a child element to a <sgmltag><rich:dataTable></sgmltag> component. The <sgmltag><rich:collapsibleSubTable></sgmltag> component iterates through the child collections in the currently iterated object to create master-detail tables.
</para>
+ <para>
+ Additionally, the detail part of the table can be collapsed or expanded through different modes. The <sgmltag><rich:collapsibleSubTable></sgmltag> component works with the <sgmltag><rich:collapsibleSubTableToggler></sgmltag> component, which expands and collapses the sub-tables.
+ </para>
<section id="sect-Component_Reference-richcollapsibleSubTable-Basic_usage">
<title>Basic usage</title>
@@ -678,6 +693,13 @@
Refer to <xref linkend="exam-Component_Reference-richcollapsibleSubTable-Basic_usage" /> for an example using the <sgmltag><rich:collapsibleSubTable></sgmltag> component. In the example, the toggle control is placed in a column that spans the width of the table. Output text next to the toggle control displays the car vendor's name for that sub-table.
</para>
</section>
+
+ <section id="sect-Component_Reference-richcollapsibleSubTableToggler-Appearance">
+ <title>Appearance</title>
+ <para>
+ The icons and labels of the <sgmltag><rich:collapsibleSubTableToggler></sgmltag> component can be customized. Use the <varname>collapsedIcon</varname> and <varname>expandedIcon</varname> attributes to specify icons for the toggler when it is collapsed and expanded respectively. Use the <varname>collapsedLabel</varname> and <varname>expandedLabel</varname> attributes to specify labels for the toggler when it is collapsed and expanded respectively.
+ </para>
+ </section>
<section id="sect-Component_Reference-richcollapsibleSubTableToggler-Reference_data">
<title>Reference data</title>
@@ -721,7 +743,7 @@
<section id="sect-Component_Reference-Tables_and_grids-richextendedDataTable">
<title><sgmltag><rich:extendedDataTable></sgmltag></title>
<para>
- The <sgmltag><rich:extendedDataTable></sgmltag> component builds on the functionality of the <sgmltag><rich:dataTable></sgmltag> component, adding features such as data scrolling, row and column selection, and rearranging of columns.
+ The <sgmltag><rich:extendedDataTable></sgmltag> component builds on the functionality of the <sgmltag><rich:dataTable></sgmltag> component, adding features such as scrolling for the table body (both horizontal and vertical), Ajax loading for vertical scrolling, frozen columns, row selection, and rearranging of columns. It also supports all the basic table features such as sorting, filtering, and paging using the <sgmltag><rich:dataScroller></sgmltag> component.
</para>
<para>
The <sgmltag><rich:extendedDataTable></sgmltag> component includes the following main attributes not included in the <sgmltag><rich:dataTable></sgmltag> component:
@@ -762,51 +784,7 @@
<varname>selectionMode</varname>
</para>
</listitem>
- <!--
- <listitem>
- <para>
- <varname>tableState</varname>
- </para>
- </listitem>
- -->
</itemizedlist>
- <para>
- The <sgmltag><rich:extendedDataTable></sgmltag> component does <emphasis>not</emphasis> include the following attributes available with the <sgmltag><rich:dataTable></sgmltag> component:
- </para>
- <itemizedlist>
- <!--
- <listitem>
- <para>
- <varname>columns</varname>
- </para>
- </listitem>
- <listitem>
- <para>
- <varname>columnsWidth</varname>
- </para>
- </listitem>
- -->
- <listitem>
- <para>
- <varname>breakBefore</varname>
- </para>
- </listitem>
- <listitem>
- <para>
- <varname>columnGroup</varname>
- </para>
- </listitem>
- <listitem>
- <para>
- <varname>colSpan</varname>
- </para>
- </listitem>
- <listitem>
- <para>
- <varname>rowSpan</varname>
- </para>
- </listitem>
- </itemizedlist>
<note>
<title>Complex sub-tables</title>
@@ -814,21 +792,21 @@
Due to the complex mark-up involved in the <sgmltag><rich:extendedDataTable></sgmltag> component, it does not support the use of the <sgmltag><rich:collapsibleSubTable></sgmltag> component. The <sgmltag><rich:collapsibleSubTable></sgmltag> component is only available with the <sgmltag><rich:dataTable></sgmltag> component.
</para>
<para>
- Similarly, complex row and column spanning using the <varname>breakBefore</varname>, <varname>columnGroup</varname>, <varname>colSpan</varname>, and <varname>rowSpan</varname> attributes is also not available with the <sgmltag><rich:extendedDataTable></sgmltag> component.
+ Similarly, complex row and column spanning using the <varname>breakBefore</varname>, <varname>colSpan</varname>, and <varname>rowSpan</varname> attributes is also not available with the <sgmltag><rich:extendedDataTable></sgmltag> component.
</para>
</note>
<section id="sect-Component_Reference-richextendedDataTable-Basic_usage">
<title>Basic usage</title>
<para>
- Basic use of the <sgmltag><rich:extendedDataTable></sgmltag> component requires the <varname>value</varname> and <varname>var</varname> attributes, the same as with the <sgmltag><rich:dataTable></sgmltag> component. Refer to <xref linkend="sect-Component_Reference-Tables_and_grids-richdataTable" /> for details.
+ Basic use of the <sgmltag><rich:extendedDataTable></sgmltag> component requires the <varname>value</varname> and <varname>var</varname> attributes, the same as with the <sgmltag><rich:dataTable></sgmltag> component. In addition, a set of columns must be included to define the table content. Refer to <xref linkend="sect-Component_Reference-Tables_and_grids-richdataTable" /> for details.
</para>
</section>
<section id="sect-Component_Reference-richextendedDataTable-Table_appearance">
<title>Table appearance</title>
<para>
- The <varname>height</varname> attribute defines the height of the table on the page. This is set to <literal>100%</literal> by default. The width of the table can be set by using the <varname>width</varname> attribute. As with the <sgmltag><rich:dataTable></sgmltag> component, the look of the <sgmltag><rich:extendedDataTable></sgmltag> component can be customized and skinned using the <literal>header</literal> and <literal>footer</literal> facets.
+ As with the <sgmltag><rich:dataTable></sgmltag> component, the look of the <sgmltag><rich:extendedDataTable></sgmltag> component can be customized using the <literal>header</literal> and <literal>footer</literal> facets.
</para>
</section>
@@ -861,7 +839,7 @@
Large tables can use Ajax "lazy" loading to cache data on the client during scrolling. Use the <varname>clientRows</varname> attribute to specify the number of rows to load. The specified number of rows are loaded on the initial rendering and with every vertical scroll. If the <varname>clientRows</varname> attribute is not specified, all the rows are loaded on the client without the use of Ajax.
</para>
<para>
- In addition to Ajax scrolling, the <sgmltag><rich:extendedDataTable></sgmltag> component can also be used with the <sgmltag><rich:dataScroller></sgmltag> component in the same way as a regular <sgmltag><rich:dataTable></sgmltag> component. Refer to <xref linkend="sect-Component_Reference-Tables_and_grids-richdataScroller" /> for full details on using the <sgmltag><rich:dataScroller></sgmltag> component.
+ In addition to Ajax scrolling, the <sgmltag><rich:extendedDataTable></sgmltag> component can also be used with the <sgmltag><rich:dataScroller></sgmltag> component in the same way as a regular <sgmltag><rich:dataTable></sgmltag> component. If both the <varname>clientRows</varname> and <varname>rows</varname> attributes are included, Ajax loading occurs as defined by the <varname>clientRows</varname> attribute, but the loading is limited to the current table page as determined by the <varname>rows</varname> attribute. Refer to <xref linkend="sect-Component_Reference-Tables_and_grids-richdataScroller" /> for full details on using the <sgmltag><rich:dataScroller></sgmltag> component.
</para>
</section>
@@ -1488,7 +1466,7 @@
<section id="sect-Component_Reference-richdataScroller-Basic_usage">
<title>Basic usage</title>
<para>
- The <sgmltag><rich:dataScroller></sgmltag> must be placed in the <literal>footer</literal> facet of the table or grid it needs to control. Alternatively, use the <varname>for</varname> attribute to bind the parent table or grid to the scroller.
+ The <sgmltag><rich:dataScroller></sgmltag> must be placed in a facet of the table or grid it needs to control. Alternatively, use the <varname>for</varname> attribute to bind the parent table or grid to the scroller.
</para>
<para>
The bound table or grid should also have the <varname>rows</varname> attribute defined to limit the number of rows per page.
@@ -1531,6 +1509,8 @@
</listitem>
</varlistentry>
</variablelist>
+ <!-- TODO not in Final -->
+ <!--
<para>
The <varname>pageIndexVar</varname> and <varname>pagesVar</varname> attributes are request-scope variables for the current page and the total number of pages. Use these attributes with the <literal>pages</literal> facet to provide information about the pages of the table, as shown in <xref linkend="exam-Component_Reference-richdataScroller-pages_facet" />.
</para>
@@ -1538,6 +1518,7 @@
<title><literal>pages</literal> facet</title>
<programlisting language="XML" role="XML"><xi:include parse="text" href="extras/exam-Component_Reference-richdataScroller-pages_facet.xml_sample" xmlns:xi="http://www.w3.org/2001/XInclude" /></programlisting>
</example>
+ -->
<para>
To add optional separators between controls, define the separators with the <literal>controlsSeparator</literal> facet.
</para>
@@ -1722,9 +1703,12 @@
</para>
</important>
+ <!-- TODO: Not in Final -->
+ <!--
<para>
Tables entries can be filtered by the user through either the basic method built in to the <sgmltag><rich:column></sgmltag> component, or by defining external filters. Refer to <xref linkend="sect-Component_Reference-Tables_and_grids-richcolumn" /> for details on using the <sgmltag><rich:column></sgmltag> component in tables.
</para>
+
<section id="sect-Component_Reference-Table_filtering-Basic_filtering">
<title>Basic filtering</title>
<para>
@@ -1759,12 +1743,16 @@
<para>
If you require more advanced filtering using custom functions or expressions, use the external filtering properties of the <sgmltag><rich:column></sgmltag> component.
</para>
+ -->
<para>
- Use the <varname>filterExpression</varname> attribute to define an expression that can be evaluated as a boolean value. The expression checks if each table entry satisfies the filtering condition when the table is rendered.
+ Use the <varname>filterExpression</varname> attribute to define an expression that can be evaluated as a boolean value. The expression checks if each table entry satisfies the filtering condition when the table is rendered. For example, the expression might be a JSTL (JavaServer Pages Standard Tag Library) function such as <function>contains</function> or <function>equals</function>.
</para>
<para>
- Use the <varname>filterMethod</varname> attribute to define a method binding. The method needs to accept an object as a parameter and return a boolean value. Similar to the <varname>filterExpression</varname> attribute, the table is rendered only with those entries that satisfy the filtering condition. By defining a custom filtering method, you can implement complex business logic to filter a table.
+ Use the <varname>filter</varname> attribute to define a filter interface. The attribute must use EL (Expression Language) to point to an object which implements the <interfacename>org.richfaces.model.Filter<T></interfacename> interface. The object must provide a single <methodname>accept(T t)</methodname> method. The method takes each iteration object as a parameter and returns a boolean value, which determines whether the object satisfies the filter. By defining a custom filter, you can implement complex business logic to filter a table.
</para>
+ <para>
+ Use the <varname>filterValue</varname> attribute to point to an object which holds the current filtering value for the column. The attribute can be used to store filtering conditions in a session. Alternatively, use the <varname>filterValue</varname> attribute when using the JavaScript API for filtering. The attribute can store a value to pass as parameter to a JavaScript filter method.
+ </para>
<example id="exam-Component_Reference-Table_filtering-External_filtering">
<title>External filtering</title>
<programlisting language="XML" role="XML"><xi:include parse="text" href="extras/exam-Component_Reference-Table_filtering-External_filtering.xml_sample" xmlns:xi="http://www.w3.org/2001/XInclude" /></programlisting>
@@ -1782,7 +1770,7 @@
</textobject>
</mediaobject>
</example>
- </section>
+ <!--</section>-->
</section>
<section id="sect-Component_Reference-Tables_and_grids-Table_sorting">
@@ -1838,15 +1826,21 @@
Use the <varname>sortMode</varname> attribute to determine how multiple columns are sorted. By default, the value of the <varname>sortMode</varname> attribute is <literal>single</literal>, so tables are only sorted by a single column. Each time the header of a column is clicked the entire table is re-sorted according to that column. Set <code>sortMode="multiple"</code> to allow tables to be sorted by a primary column, then by a secondary column, and so on.
</para>
</section>
- -->
<section id="sect-Component_Reference-Table_sorting-External_sorting">
<title>External sorting</title>
+ -->
<para>
- Bind the <varname>sortOrder</varname> attribute to bean properties to manage the sorting order externally. The bean must handle all the sorting algorithms. <xref linkend="exam-Component_Reference-Table_sorting-External_sorting" /> demonstrates table sorting using an external control.
+ Set the <varname>sortBy</varname> attribute to indicate which iteration object property to use when sorting the column. By default, the target will be sorted using the <methodname>compare()</methodname> method.
</para>
- <example id="exam-Component_Reference-Table_sorting-External_sorting">
- <title>External sorting</title>
+ <para>
+ If using custom-defined rules for sorting, use the <varname>comparator</varname> attribute instead. Set the <varname>comparator</varname> attribute to point to your comparator method, which will be used when sorting the data model.
+ </para>
+ <para>
+ Bind the <varname>sortOrder</varname> attribute to bean properties to manage the sorting order. The bean must handle all the sorting algorithms. <xref linkend="exam-Component_Reference-Table_sorting-External_sorting" /> demonstrates table sorting using an external control.
+ </para>
+ <example id="exam-Component_Reference-Table_sorting-Sorting">
+ <title>Sorting</title>
<programlisting language="XML" role="XML"><xi:include parse="text" href="extras/exam-Component_Reference-Table_sorting-External_sorting.xml_sample" xmlns:xi="http://www.w3.org/2001/XInclude" /></programlisting>
<para>
The example uses an external control to manage the table's sorting.
@@ -1863,12 +1857,9 @@
</mediaobject>
</example>
<para>
- When using the <code>sortMode="multiple"</code> configuration, set the priority by which columns are sorted with the <varname>sortPriorities</varname> attribute.
+ When multiple columns are capable of being sorted at the same time, set the priority by which the columns are sorted with the <varname>sortPriorities</varname> attribute. The attribute must contain a list of column identifiers in the order of the sorting sequence.
</para>
- <para>
- Use the <varname>sortExpression</varname> attribute to define a bean property to use for sorting the column. The expression checks each table entry against the sorting expression during rendering.
- </para>
- </section>
+ <!--</section>-->
</section>
</chapter>
Added: modules/docs/trunk/Component_Reference/src/main/docbook/en-US/extras/exam-Component_Reference-a4jrepeat-Update_a_single_component.xml_sample
===================================================================
--- modules/docs/trunk/Component_Reference/src/main/docbook/en-US/extras/exam-Component_Reference-a4jrepeat-Update_a_single_component.xml_sample (rev 0)
+++ modules/docs/trunk/Component_Reference/src/main/docbook/en-US/extras/exam-Component_Reference-a4jrepeat-Update_a_single_component.xml_sample 2011-04-04 06:50:06 UTC (rev 22359)
@@ -0,0 +1,6 @@
+<rich:column>
+ <a4j:commandButton render="col"></a4j:commandButton>
+</rich:column>
+<rich:column>
+ <h:outputText value="#{car.model}" id="col"/>
+</rich:column>
13 years, 1 month
JBoss Rich Faces SVN: r22358 - in modules/docs/trunk/Component_Reference/src/main/docbook/en-US: extras and 1 other directory.
by richfaces-svn-commits@lists.jboss.org
Author: SeanRogers
Date: 2011-04-03 20:05:53 -0400 (Sun, 03 Apr 2011)
New Revision: 22358
Added:
modules/docs/trunk/Component_Reference/src/main/docbook/en-US/extras/exam-Component_Reference-a4jmediaOutput-a4jmediaOutput_example.xml_sample
Modified:
modules/docs/trunk/Component_Reference/src/main/docbook/en-US/Component_Reference.xml
modules/docs/trunk/Component_Reference/src/main/docbook/en-US/chap-Component_Reference-Resources.xml
Log:
Added mediaOutput documentation: RFPL-1400
Modified: modules/docs/trunk/Component_Reference/src/main/docbook/en-US/Component_Reference.xml
===================================================================
--- modules/docs/trunk/Component_Reference/src/main/docbook/en-US/Component_Reference.xml 2011-04-01 15:56:54 UTC (rev 22357)
+++ modules/docs/trunk/Component_Reference/src/main/docbook/en-US/Component_Reference.xml 2011-04-04 00:05:53 UTC (rev 22358)
@@ -11,9 +11,7 @@
<part id="part-Component_Reference-Ajax_control_components">
<title>Ajax control components</title>
<xi:include href="chap-Component_Reference-Actions.xml" xmlns:xi="http://www.w3.org/2001/XInclude" />
- <!--
<xi:include href="chap-Component_Reference-Resources.xml" xmlns:xi="http://www.w3.org/2001/XInclude" />
- -->
<xi:include href="chap-Component_Reference-Containers.xml" xmlns:xi="http://www.w3.org/2001/XInclude" />
<xi:include href="chap-Component_Reference-Validation.xml" xmlns:xi="http://www.w3.org/2001/XInclude" />
<xi:include href="chap-Component_Reference-Processing_management.xml" xmlns:xi="http://www.w3.org/2001/XInclude" />
Modified: modules/docs/trunk/Component_Reference/src/main/docbook/en-US/chap-Component_Reference-Resources.xml
===================================================================
--- modules/docs/trunk/Component_Reference/src/main/docbook/en-US/chap-Component_Reference-Resources.xml 2011-04-01 15:56:54 UTC (rev 22357)
+++ modules/docs/trunk/Component_Reference/src/main/docbook/en-US/chap-Component_Reference-Resources.xml 2011-04-04 00:05:53 UTC (rev 22358)
@@ -192,6 +192,8 @@
</section>
-->
+ <!-- <a4j:keepAlive> -->
+ <!--
<section id="sect-Component_Reference-Resources-a4jkeepAlive">
<title><sgmltag><a4j:keepAlive></sgmltag></title>
<para>
@@ -240,124 +242,123 @@
</itemizedlist>
</section>
</section>
+ -->
- <!-- TODO not in M2 -->
- <!--
+ <!-- <a4j:mediaOutput> -->
<section id="sect-Component_Reference-Resources-a4jmediaOutput">
<title><sgmltag><a4j:mediaOutput></sgmltag></title>
- <itemizedlist>
- <listitem>
- <para>
- <parameter>component-type</parameter>: <classname>org.ajax4jsf.Push</classname>
- </para>
- </listitem>
- <listitem>
- <para>
- <parameter>component-class</parameter>: <classname>org.ajax4jsf.component.html.AjaxPush</classname>
- </para>
- </listitem>
- <listitem>
- <para>
- <parameter>component-family</parameter>: <classname>org.ajax4jsf.components.AjaxPush</classname>
- </para>
- </listitem>
- <listitem>
- <para>
- <parameter>renderer-type</parameter>: <classname>org.ajax4jsf.components.AjaxPushRenderer</classname>
- </para>
- </listitem>
- </itemizedlist>
<para>
The <sgmltag><a4j:mediaOutput></sgmltag> component is used for generating images, video, sounds, and other resources defined on the fly.
</para>
- <para>
- The <varname>createContent</varname> attribute points to the method used for generating the displayed content. If necessary, the <varname>value</varname> attribute can be used to pass input data to the content generation method specified with <varname>createContent</varname>. The <varname>cacheable</varname> attribute specifies whether the resulting content will be cached or not.
- </para>
- <para>
- The <varname>mimeType</varname> attribute describes the type of output content, and corresponds to the type in the header of the <acronym>HTTP</acronym> request. The <varname>element</varname> attribute defines <acronym>XHTML</acronym> element used to display the content:
- </para>
- <itemizedlist>
- <listitem>
+ <section id="sect-Component_Reference-a4jmediaOutput-Basic_usage">
+ <title>Basic usage</title>
+ <para>
+ The <varname>createContent</varname> attribute points to the method used for generating the displayed content.
+ </para>
+ <para>
+ If necessary, the <varname>value</varname> attribute can be used to pass input data to the content generation method specified with <varname>createContent</varname>. The <varname>cacheable</varname> attribute specifies whether the resulting content will be cached or not.
+ </para>
+ </section>
+
+ <section id="sect-Component_Reference-a4jmediaOutput-Handling_content">
+ <title>Handling content</title>
+ <para>
+ The <varname>mimeType</varname> attribute describes the type of output content, and corresponds to the type in the header of the <acronym>HTTP</acronym> request. The <varname>element</varname> attribute defines <acronym>XHTML</acronym> element used to display the content:
+ </para>
+ <itemizedlist>
+ <listitem>
+ <para>
+ <literal>img</literal>
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ <literal>object</literal>
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ <literal>applet</literal>
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ <literal>script</literal>
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ <literal>link</literal>
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ <literal>a</literal>
+ </para>
+ </listitem>
+ </itemizedlist>
+ <example id="exam-Component_Reference-a4jmediaOutput-a4jmediaOutput_example">
+ <title><sgmltag><a4j:mediaOutput></sgmltag> example</title>
<para>
- <literal>img</literal>
+ This example uses the <sgmltag><a4j:mediaOutput></sgmltag> component to generate a <acronym>JPEG</acronym> image of verification digits. The code on the application page is a single element:
</para>
- </listitem>
- <listitem>
+ <programlisting language="XML" role="XML"><xi:include href="extras/exam-Component_Reference-a4jmediaOutput-a4jmediaOutput_example.xml_sample" parse="text" xmlns:xi="http://www.w3.org/2001/XInclude" /></programlisting>
<para>
- <literal>object</literal>
+ The <sgmltag><a4j:mediaOutput></sgmltag> component uses the <methodname>MediaBean.paint</methodname> method to create the image. The method generates a random number, which is then converted into an output stream and rendered to a <acronym>JPEG</acronym> image. The <classname>MediaBean</classname> class is as follows:
</para>
- </listitem>
- <listitem>
+ <programlisting language="Java" role="JAVA"><xi:include href="extras/exam-Component_Reference-a4jmediaOutput-a4jmediaOutput_example-0.js" parse="text" xmlns:xi="http://www.w3.org/2001/XInclude" /></programlisting>
<para>
- <literal>applet</literal>
+ Another class, <classname>MediaData</classname> is required by the <varname>value</varname> attribute for keeping data to be used as input for the content creation method. The <classname>MediaData</classname> class is as follows:
</para>
- </listitem>
- <listitem>
+ <programlisting language="Java" role="JAVA"><xi:include href="extras/exam-Component_Reference-a4jmediaOutput-a4jmediaOutput_example-1.js" parse="text" xmlns:xi="http://www.w3.org/2001/XInclude" /></programlisting>
<para>
- <literal>script</literal>
+ The <sgmltag><a4j:mediaOutput></sgmltag> component uses the <classname>MediaBean</classname> and <classname>MediaData</classname> classes to generate a new image on each page refresh.
</para>
- </listitem>
- <listitem>
+ <mediaobject>
+ <imageobject>
+ <imagedata fileref="images/figu-Component_Reference-a4jmediaOutput-a4jmediaOutput_example_result.png" format="PNG" />
+ </imageobject>
+ <textobject>
+ <para>
+ The generated image containing a random verification number.
+ </para>
+ </textobject>
+ </mediaobject>
+ </example>
+ <note>
+ <title><classname>Serializable</classname> interface</title>
<para>
- <literal>link</literal>
+ A bean class passed using the <varname>value</varname> attribute of <sgmltag><a4j:mediaOutput></sgmltag> should implement the <classname>Serializable</classname> interface so that it will be encoded to the <acronym>URL</acronym> of the resource.
</para>
- </listitem>
- <listitem>
- <para>
- <literal>a</literal>
- </para>
- </listitem>
- </itemizedlist>
- <example id="exam-Component_Reference-a4jmediaOutput-a4jmediaOutput_example">
- <title><sgmltag><a4j:mediaOutput></sgmltag> example</title>
- <para>
- This example uses the <sgmltag><a4j:mediaOutput></sgmltag> component to generate a <acronym>JPEG</acronym> image of verification digits. The code on the application page is a single element:
- </para>
-
-<programlisting language="XML" role="XML">
-<a4j:mediaOutput element="img" cacheable="false" session="false" createContent="#{mediaBean.paint}" value="#{mediaData}" mimeType="image/jpeg" />
-</programlisting>
- <para>
- The <sgmltag><a4j:mediaOutput></sgmltag> component uses the <methodname>MediaBean.paint</methodname> method to create the image. The method generates a random number, which is then converted into an output stream and rendered to a <acronym>JPEG</acronym> image. The <classname>MediaBean</classname> class is as follows:
- </para>
-
-<programlisting language="Java" role="JAVA">
-<xi:include href="extras/exam-Component_Reference-a4jmediaOutput-a4jmediaOutput_example-0.js" parse="text" xmlns:xi="http://www.w3.org/2001/XInclude" />
-</programlisting>
- <para>
- Another class, <classname>MediaData</classname> is required by the <varname>value</varname> attribute for keeping data to be used as input for the content creation method. The <classname>MediaData</classname> class is as follows:
- </para>
-
-<programlisting language="Java" role="JAVA">
-<xi:include href="extras/exam-Component_Reference-a4jmediaOutput-a4jmediaOutput_example-1.js" parse="text" xmlns:xi="http://www.w3.org/2001/XInclude" />
-</programlisting>
- <para>
- The <sgmltag><a4j:mediaOutput></sgmltag> component uses the <classname>MediaBean</classname> and <classname>MediaData</classname> classes to generate a new image on each page refresh, which appears as shown in <xref linkend="figu-Component_Reference-a4jmediaOutput_example-a4jmediaOutput_example_result" />
- </para>
- <blockquote>
- <figure id="figu-Component_Reference-a4jmediaOutput_example-a4jmediaOutput_example_result">
- <title><sgmltag><a4j:mediaOutput></sgmltag> example result</title>
- <mediaobject>
- <imageobject>
- <imagedata fileref="images/figu-Component_Reference-a4jmediaOutput-a4jmediaOutput_example_result.png" format="PNG" />
- </imageobject>
- <textobject>
- <para>
- The generated image containing a random verification number.
- </para>
- </textobject>
- </mediaobject>
- </figure>
- </blockquote>
- </example>
- <note>
- <title><classname>Serializable</classname> interface</title>
- <para>
- A bean class passed using the <varname>value</varname> attribute of <sgmltag><a4j:mediaOutput></sgmltag> should implement the <classname>Serializable</classname> interface so that it will be encoded to the <acronym>URL</acronym> of the resource.
- </para>
- </note>
+ </note>
+ </section>
+
+ <section id="sect-Component_Reference-a4jmediaOutput-Reference_data">
+ <title>Reference data</title>
+ <itemizedlist>
+ <listitem>
+ <para>
+ <parameter>component-type</parameter>: <classname>org.ajax4jsf.Push</classname>
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ <parameter>component-class</parameter>: <classname>org.ajax4jsf.component.html.AjaxPush</classname>
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ <parameter>component-family</parameter>: <classname>org.ajax4jsf.components.AjaxPush</classname>
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ <parameter>renderer-type</parameter>: <classname>org.ajax4jsf.components.AjaxPushRenderer</classname>
+ </para>
+ </listitem>
+ </itemizedlist>
+ </section>
</section>
- -->
</chapter>
Added: modules/docs/trunk/Component_Reference/src/main/docbook/en-US/extras/exam-Component_Reference-a4jmediaOutput-a4jmediaOutput_example.xml_sample
===================================================================
--- modules/docs/trunk/Component_Reference/src/main/docbook/en-US/extras/exam-Component_Reference-a4jmediaOutput-a4jmediaOutput_example.xml_sample (rev 0)
+++ modules/docs/trunk/Component_Reference/src/main/docbook/en-US/extras/exam-Component_Reference-a4jmediaOutput-a4jmediaOutput_example.xml_sample 2011-04-04 00:05:53 UTC (rev 22358)
@@ -0,0 +1,3 @@
+<a4j:mediaOutput element="img" cacheable="false" session="false"
+ createContent="#{mediaBean.paint}" value="#{mediaData}"
+ mimeType="image/jpeg" />
13 years, 1 month
JBoss Rich Faces SVN: r22357 - in trunk: ui/common/ui/src/main/java/org/richfaces/view/facelets and 1 other directory.
by richfaces-svn-commits@lists.jboss.org
Author: nbelaevski
Date: 2011-04-01 11:56:54 -0400 (Fri, 01 Apr 2011)
New Revision: 22357
Modified:
trunk/core/impl/src/main/java/org/richfaces/skin/AbstractSkinFactory.java
trunk/ui/common/ui/src/main/java/org/richfaces/view/facelets/EventListenerHandler.java
Log:
Fixed wrong message for skin not found
EventListenerHandler code optimization
Modified: trunk/core/impl/src/main/java/org/richfaces/skin/AbstractSkinFactory.java
===================================================================
--- trunk/core/impl/src/main/java/org/richfaces/skin/AbstractSkinFactory.java 2011-04-01 15:28:10 UTC (rev 22356)
+++ trunk/core/impl/src/main/java/org/richfaces/skin/AbstractSkinFactory.java 2011-04-01 15:56:54 UTC (rev 22357)
@@ -166,9 +166,9 @@
skinFuture.run();
return skinFuture.get();
} catch (InterruptedException e) {
- throw new SkinNotFoundException(Messages.getMessage(Messages.SKIN_NOT_FOUND_ERROR), e);
+ throw new SkinNotFoundException(Messages.getMessage(Messages.SKIN_NOT_FOUND_ERROR, name), e);
} catch (ExecutionException e) {
- throw new SkinNotFoundException(Messages.getMessage(Messages.SKIN_NOT_FOUND_ERROR), e);
+ throw new SkinNotFoundException(Messages.getMessage(Messages.SKIN_NOT_FOUND_ERROR, name), e);
}
}
Modified: trunk/ui/common/ui/src/main/java/org/richfaces/view/facelets/EventListenerHandler.java
===================================================================
--- trunk/ui/common/ui/src/main/java/org/richfaces/view/facelets/EventListenerHandler.java 2011-04-01 15:28:10 UTC (rev 22356)
+++ trunk/ui/common/ui/src/main/java/org/richfaces/view/facelets/EventListenerHandler.java 2011-04-01 15:56:54 UTC (rev 22357)
@@ -30,7 +30,7 @@
import javax.faces.event.AbortProcessingException;
import javax.faces.event.FacesEvent;
import javax.faces.event.FacesListener;
-import javax.faces.view.EditableValueHolderAttachedObjectHandler;
+import javax.faces.view.AttachedObjectHandler;
import javax.faces.view.facelets.ComponentHandler;
import javax.faces.view.facelets.FaceletContext;
import javax.faces.view.facelets.TagAttribute;
@@ -43,7 +43,7 @@
* @author akolonitsky
* @since Aug 31, 2010
*/
-public abstract class EventListenerHandler extends TagHandler implements EditableValueHolderAttachedObjectHandler {
+public abstract class EventListenerHandler extends TagHandler implements AttachedObjectHandler {
protected final TagAttribute binding;
@@ -75,7 +75,7 @@
}
if (instance == null && this.type != null) {
try {
- instance = (L) forName(this.type).newInstance();
+ instance = (L) TagHandlerUtils.loadClass(this.type, Object.class).newInstance();
} catch (Exception e) {
throw new AbortProcessingException("Couldn't Lazily instantiate EventListener", e);
}
@@ -97,7 +97,7 @@
if (type != null) {
if (type.isLiteral()) {
try {
- forName(type.getValue());
+ TagHandlerUtils.loadClass(type.getValue(), Object.class);
} catch (ClassNotFoundException e) {
throw new TagAttributeException(type, "Couldn't qualify EventListener", e);
}
@@ -123,7 +123,7 @@
// Allow the composite component to know about the target component.
TagHandlerUtils.getOrCreateRetargetableHandlersList(parent).add(this);
} else {
- throw new TagException(this.tag, "Parent is not of type EditableValueHolder, type is: " + parent);
+ throw new TagException(this.tag, "Parent does not match event source requirements: " + parent);
}
}
@@ -132,14 +132,6 @@
return attr == null ? null : attr.getValue();
}
- public static Class<?> forName(String name) throws ClassNotFoundException {
- if (null == name || "".equals(name)) {
- return null;
- }
-
- return Class.forName(name, false, Thread.currentThread().getContextClassLoader());
- }
-
public abstract boolean isEventSource(UIComponent comp);
}
13 years, 1 month
JBoss Rich Faces SVN: r22356 - in trunk/ui: common/ui/src/main/java/org/richfaces/component/behavior and 3 other directories.
by richfaces-svn-commits@lists.jboss.org
Author: nbelaevski
Date: 2011-04-01 11:28:10 -0400 (Fri, 01 Apr 2011)
New Revision: 22356
Added:
trunk/ui/common/ui/src/main/java/org/richfaces/component/behavior/
trunk/ui/common/ui/src/main/java/org/richfaces/component/behavior/BehaviorStateHelper.java
trunk/ui/common/ui/src/main/java/org/richfaces/component/behavior/ClientBehavior.java
Removed:
trunk/ui/core/ui/src/main/java/org/ajax4jsf/component/behavior/BehaviorStateHelper.java
trunk/ui/core/ui/src/main/java/org/ajax4jsf/component/behavior/ClientBehavior.java
Modified:
trunk/ui/core/ui/src/main/java/org/ajax4jsf/component/behavior/AjaxBehavior.java
trunk/ui/core/ui/src/main/java/org/richfaces/view/facelets/html/BehaviorTagHandlerDelegate.java
trunk/ui/core/ui/src/main/java/org/richfaces/view/facelets/tag/BehaviorRule.java
Log:
CleitnBehavior moved to another location
Copied: trunk/ui/common/ui/src/main/java/org/richfaces/component/behavior/BehaviorStateHelper.java (from rev 22354, trunk/ui/core/ui/src/main/java/org/ajax4jsf/component/behavior/BehaviorStateHelper.java)
===================================================================
--- trunk/ui/common/ui/src/main/java/org/richfaces/component/behavior/BehaviorStateHelper.java (rev 0)
+++ trunk/ui/common/ui/src/main/java/org/richfaces/component/behavior/BehaviorStateHelper.java 2011-04-01 15:28:10 UTC (rev 22356)
@@ -0,0 +1,52 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright ${year}, Red Hat, Inc. and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+
+package org.richfaces.component.behavior;
+
+import javax.el.ValueExpression;
+import javax.faces.context.FacesContext;
+
+import org.richfaces.component.PartialStateHolderHelper;
+
+/**
+ * @author Anton Belevich
+ *
+ */
+public class BehaviorStateHelper extends PartialStateHolderHelper {
+
+ private ClientBehavior behavior;
+
+ public BehaviorStateHelper(ClientBehavior behavior) {
+ super(behavior);
+ this.behavior = behavior;
+ }
+
+ @Override
+ protected Object getValueExpressionValue(String name) {
+ Object retVal = null;
+ ValueExpression ve = behavior.getValueExpression(name);
+ if (ve != null) {
+ retVal = ve.getValue(FacesContext.getCurrentInstance().getELContext());
+ }
+ return retVal;
+ }
+}
Copied: trunk/ui/common/ui/src/main/java/org/richfaces/component/behavior/ClientBehavior.java (from rev 22354, trunk/ui/core/ui/src/main/java/org/ajax4jsf/component/behavior/ClientBehavior.java)
===================================================================
--- trunk/ui/common/ui/src/main/java/org/richfaces/component/behavior/ClientBehavior.java (rev 0)
+++ trunk/ui/common/ui/src/main/java/org/richfaces/component/behavior/ClientBehavior.java 2011-04-01 15:28:10 UTC (rev 22356)
@@ -0,0 +1,192 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright ${year}, Red Hat, Inc. and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+
+package org.richfaces.component.behavior;
+
+import java.io.Serializable;
+import java.util.HashMap;
+import java.util.Map;
+
+import javax.el.ELContext;
+import javax.el.ELException;
+import javax.el.ValueExpression;
+import javax.faces.FacesException;
+import javax.faces.component.StateHelper;
+import javax.faces.component.UIComponentBase;
+import javax.faces.component.behavior.ClientBehaviorBase;
+import javax.faces.context.FacesContext;
+
+/**
+ * @author Anton Belevich
+ *
+ * base class for the client behaviors
+ */
+public abstract class ClientBehavior extends ClientBehaviorBase {
+
+ private StateHelper behaviorStateHelper = null;
+
+ private Map<String, ValueExpression> bindings;
+
+ public StateHelper getStateHelper() {
+ if (behaviorStateHelper == null) {
+ behaviorStateHelper = new BehaviorStateHelper(this);
+ }
+ return behaviorStateHelper;
+ }
+
+ public ValueExpression getValueExpression(String name) {
+ if (name == null) {
+ throw new NullPointerException();
+ }
+
+ return ((bindings == null) ? null : bindings.get(name));
+ }
+
+ public void setValueExpression(String name, ValueExpression valueExpression) {
+ if (name == null) {
+ throw new NullPointerException();
+ }
+
+ if (valueExpression != null) {
+
+ if (valueExpression.isLiteralText()) {
+ setLiteralValue(name, valueExpression);
+ } else {
+ if (bindings == null) {
+ bindings = new HashMap<String, ValueExpression>(6, 1.0f);
+ }
+ bindings.put(name, valueExpression);
+ }
+
+ } else {
+ if (bindings != null) {
+ bindings.remove(name);
+ if (bindings.isEmpty()) {
+ bindings = null;
+ }
+ }
+ }
+ clearInitialState();
+ }
+
+ protected FacesContext getFacesContext() {
+ return FacesContext.getCurrentInstance();
+ }
+
+ public void setLiteralValue(String name, ValueExpression expression) {
+ assert (expression.isLiteralText());
+ ELContext context = getFacesContext().getELContext();
+
+ try {
+ setLiteralAttribute(name, expression.getValue(context));
+ } catch (ELException elem) {
+ throw new FacesException(elem);
+ }
+ }
+
+ public abstract void setLiteralAttribute(String name, Object value);
+
+ @Override
+ public Object saveState(FacesContext context) {
+ Object[] state = null;
+
+ Object parentState = super.saveState(context);
+ if (initialStateMarked()) {
+ if (parentState != null) {
+ state = new Object[] { parentState };
+ }
+ } else {
+
+ Object savedHelper = null;
+ if(behaviorStateHelper != null) {
+ savedHelper = behaviorStateHelper.saveState(context);
+ }
+
+ state = new Object[3];
+ state[0] = parentState;
+ state[1] = savedHelper;
+ state[2] = saveBindings(context, bindings);
+
+ }
+ return state;
+ }
+
+ @Override
+ public void restoreState(FacesContext context, Object state) {
+ if (state != null) {
+ Object[] stateObject = (Object[]) state;
+ super.restoreState(context, stateObject[0]);
+
+ if (stateObject.length == 3) {
+ getStateHelper().restoreState(context, stateObject[1]);
+ this.bindings = restoreBindings(context, stateObject[2]);
+
+ clearInitialState();
+ }
+ }
+ }
+
+ // Utility for saving bindings state
+ private static Object saveBindings(FacesContext context, Map<String, ValueExpression> bindings) {
+
+ if (bindings == null) {
+ return (null);
+ }
+
+ Object[] values = new Object[2];
+ values[0] = bindings.keySet().toArray(new String[bindings.size()]);
+
+ Object[] bindingValues = bindings.values().toArray();
+ for (int i = 0; i < bindingValues.length; i++) {
+ bindingValues[i] = UIComponentBase.saveAttachedState(context, bindingValues[i]);
+ }
+
+ values[1] = bindingValues;
+
+ return (values);
+ }
+
+ // Utility for restoring bindings from state
+ private static Map<String, ValueExpression> restoreBindings(FacesContext context, Object state) {
+ if (state == null) {
+ return (null);
+ }
+
+ Object[] values = (Object[]) state;
+ String[] names = (String[]) values[0];
+ Object[] states = (Object[]) values[1];
+ Map<String, ValueExpression> bindings = new HashMap<String, ValueExpression>();
+ for (int i = 0; i < names.length; i++) {
+ bindings.put(names[i], (ValueExpression) UIComponentBase.restoreAttachedState(context, states[i]));
+ }
+ return (bindings);
+ }
+
+ protected boolean compare(Serializable key, String name) {
+ boolean retValue = false;
+ if (key != null) {
+ String keyName = key.toString();
+ retValue = keyName.equals(name);
+ }
+ return retValue;
+ }
+}
Modified: trunk/ui/core/ui/src/main/java/org/ajax4jsf/component/behavior/AjaxBehavior.java
===================================================================
--- trunk/ui/core/ui/src/main/java/org/ajax4jsf/component/behavior/AjaxBehavior.java 2011-04-01 15:23:27 UTC (rev 22355)
+++ trunk/ui/core/ui/src/main/java/org/ajax4jsf/component/behavior/AjaxBehavior.java 2011-04-01 15:28:10 UTC (rev 22356)
@@ -46,6 +46,7 @@
import org.richfaces.cdk.annotations.Signature;
import org.richfaces.cdk.annotations.Tag;
import org.richfaces.cdk.annotations.TagType;
+import org.richfaces.component.behavior.ClientBehavior;
import org.richfaces.event.BypassUpdatesAjaxBehaviorEvent;
import org.richfaces.renderkit.util.CoreAjaxRendererUtils;
Deleted: trunk/ui/core/ui/src/main/java/org/ajax4jsf/component/behavior/BehaviorStateHelper.java
===================================================================
--- trunk/ui/core/ui/src/main/java/org/ajax4jsf/component/behavior/BehaviorStateHelper.java 2011-04-01 15:23:27 UTC (rev 22355)
+++ trunk/ui/core/ui/src/main/java/org/ajax4jsf/component/behavior/BehaviorStateHelper.java 2011-04-01 15:28:10 UTC (rev 22356)
@@ -1,52 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright ${year}, Red Hat, Inc. and individual contributors
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-
-package org.ajax4jsf.component.behavior;
-
-import javax.el.ValueExpression;
-import javax.faces.context.FacesContext;
-
-import org.richfaces.component.PartialStateHolderHelper;
-
-/**
- * @author Anton Belevich
- *
- */
-public class BehaviorStateHelper extends PartialStateHolderHelper {
-
- private ClientBehavior behavior;
-
- public BehaviorStateHelper(ClientBehavior behavior) {
- super(behavior);
- this.behavior = behavior;
- }
-
- @Override
- protected Object getValueExpressionValue(String name) {
- Object retVal = null;
- ValueExpression ve = behavior.getValueExpression(name);
- if (ve != null) {
- retVal = ve.getValue(FacesContext.getCurrentInstance().getELContext());
- }
- return retVal;
- }
-}
Deleted: trunk/ui/core/ui/src/main/java/org/ajax4jsf/component/behavior/ClientBehavior.java
===================================================================
--- trunk/ui/core/ui/src/main/java/org/ajax4jsf/component/behavior/ClientBehavior.java 2011-04-01 15:23:27 UTC (rev 22355)
+++ trunk/ui/core/ui/src/main/java/org/ajax4jsf/component/behavior/ClientBehavior.java 2011-04-01 15:28:10 UTC (rev 22356)
@@ -1,192 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright ${year}, Red Hat, Inc. and individual contributors
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-
-package org.ajax4jsf.component.behavior;
-
-import java.io.Serializable;
-import java.util.HashMap;
-import java.util.Map;
-
-import javax.el.ELContext;
-import javax.el.ELException;
-import javax.el.ValueExpression;
-import javax.faces.FacesException;
-import javax.faces.component.StateHelper;
-import javax.faces.component.UIComponentBase;
-import javax.faces.component.behavior.ClientBehaviorBase;
-import javax.faces.context.FacesContext;
-
-/**
- * @author Anton Belevich
- *
- * base class for the client behaviors
- */
-public abstract class ClientBehavior extends ClientBehaviorBase {
-
- private StateHelper behaviorStateHelper = null;
-
- private Map<String, ValueExpression> bindings;
-
- public StateHelper getStateHelper() {
- if (behaviorStateHelper == null) {
- behaviorStateHelper = new BehaviorStateHelper(this);
- }
- return behaviorStateHelper;
- }
-
- public ValueExpression getValueExpression(String name) {
- if (name == null) {
- throw new NullPointerException();
- }
-
- return ((bindings == null) ? null : bindings.get(name));
- }
-
- public void setValueExpression(String name, ValueExpression valueExpression) {
- if (name == null) {
- throw new NullPointerException();
- }
-
- if (valueExpression != null) {
-
- if (valueExpression.isLiteralText()) {
- setLiteralValue(name, valueExpression);
- } else {
- if (bindings == null) {
- bindings = new HashMap<String, ValueExpression>(6, 1.0f);
- }
- bindings.put(name, valueExpression);
- }
-
- } else {
- if (bindings != null) {
- bindings.remove(name);
- if (bindings.isEmpty()) {
- bindings = null;
- }
- }
- }
- clearInitialState();
- }
-
- protected FacesContext getFacesContext() {
- return FacesContext.getCurrentInstance();
- }
-
- public void setLiteralValue(String name, ValueExpression expression) {
- assert (expression.isLiteralText());
- ELContext context = getFacesContext().getELContext();
-
- try {
- setLiteralAttribute(name, expression.getValue(context));
- } catch (ELException elem) {
- throw new FacesException(elem);
- }
- }
-
- public abstract void setLiteralAttribute(String name, Object value);
-
- @Override
- public Object saveState(FacesContext context) {
- Object[] state = null;
-
- Object parentState = super.saveState(context);
- if (initialStateMarked()) {
- if (parentState != null) {
- state = new Object[] { parentState };
- }
- } else {
-
- Object savedHelper = null;
- if(behaviorStateHelper != null) {
- savedHelper = behaviorStateHelper.saveState(context);
- }
-
- state = new Object[3];
- state[0] = parentState;
- state[1] = savedHelper;
- state[2] = saveBindings(context, bindings);
-
- }
- return state;
- }
-
- @Override
- public void restoreState(FacesContext context, Object state) {
- if (state != null) {
- Object[] stateObject = (Object[]) state;
- super.restoreState(context, stateObject[0]);
-
- if (stateObject.length == 3) {
- getStateHelper().restoreState(context, stateObject[1]);
- this.bindings = restoreBindings(context, stateObject[2]);
-
- clearInitialState();
- }
- }
- }
-
- // Utility for saving bindings state
- private static Object saveBindings(FacesContext context, Map<String, ValueExpression> bindings) {
-
- if (bindings == null) {
- return (null);
- }
-
- Object[] values = new Object[2];
- values[0] = bindings.keySet().toArray(new String[bindings.size()]);
-
- Object[] bindingValues = bindings.values().toArray();
- for (int i = 0; i < bindingValues.length; i++) {
- bindingValues[i] = UIComponentBase.saveAttachedState(context, bindingValues[i]);
- }
-
- values[1] = bindingValues;
-
- return (values);
- }
-
- // Utility for restoring bindings from state
- private static Map<String, ValueExpression> restoreBindings(FacesContext context, Object state) {
- if (state == null) {
- return (null);
- }
-
- Object[] values = (Object[]) state;
- String[] names = (String[]) values[0];
- Object[] states = (Object[]) values[1];
- Map<String, ValueExpression> bindings = new HashMap<String, ValueExpression>();
- for (int i = 0; i < names.length; i++) {
- bindings.put(names[i], (ValueExpression) UIComponentBase.restoreAttachedState(context, states[i]));
- }
- return (bindings);
- }
-
- protected boolean compare(Serializable key, String name) {
- boolean retValue = false;
- if (key != null) {
- String keyName = key.toString();
- retValue = keyName.equals(name);
- }
- return retValue;
- }
-}
Modified: trunk/ui/core/ui/src/main/java/org/richfaces/view/facelets/html/BehaviorTagHandlerDelegate.java
===================================================================
--- trunk/ui/core/ui/src/main/java/org/richfaces/view/facelets/html/BehaviorTagHandlerDelegate.java 2011-04-01 15:23:27 UTC (rev 22355)
+++ trunk/ui/core/ui/src/main/java/org/richfaces/view/facelets/html/BehaviorTagHandlerDelegate.java 2011-04-01 15:28:10 UTC (rev 22356)
@@ -34,7 +34,7 @@
import javax.faces.view.facelets.MetaRuleset;
import javax.faces.view.facelets.TagHandlerDelegate;
-import org.ajax4jsf.component.behavior.ClientBehavior;
+import org.richfaces.component.behavior.ClientBehavior;
/**
* @author Anton Belevich
Modified: trunk/ui/core/ui/src/main/java/org/richfaces/view/facelets/tag/BehaviorRule.java
===================================================================
--- trunk/ui/core/ui/src/main/java/org/richfaces/view/facelets/tag/BehaviorRule.java 2011-04-01 15:23:27 UTC (rev 22355)
+++ trunk/ui/core/ui/src/main/java/org/richfaces/view/facelets/tag/BehaviorRule.java 2011-04-01 15:28:10 UTC (rev 22356)
@@ -28,7 +28,7 @@
import javax.faces.view.facelets.MetadataTarget;
import javax.faces.view.facelets.TagAttribute;
-import org.ajax4jsf.component.behavior.ClientBehavior;
+import org.richfaces.component.behavior.ClientBehavior;
/**
* @author Anton Belevich
13 years, 1 month