Author: SeanRogers
Date: 2010-11-11 02:15:57 -0500 (Thu, 11 Nov 2010)
New Revision: 20026
Added:
modules/docs/trunk/Component_Reference/src/main/docbook/en-US/extras/exam-Component_Reference-Table_filtering-Basic_filtering.xml_sample
modules/docs/trunk/Component_Reference/src/main/docbook/en-US/extras/exam-Component_Reference-Table_filtering-External_filtering.xml_sample
modules/docs/trunk/Component_Reference/src/main/docbook/en-US/images/figu-Component_Reference-Table_filtering-Basic_filtering.png
modules/docs/trunk/Component_Reference/src/main/docbook/en-US/images/figu-Component_Reference-Table_filtering-External_filtering.png
Modified:
modules/docs/trunk/Component_Reference/src/main/docbook/en-US/chap-Component_Reference-Actions.xml
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/extras/exam-Component_Reference-a4jajax-a4jajax_example.xml_sample
Log:
Added table filtering section
Modified:
modules/docs/trunk/Component_Reference/src/main/docbook/en-US/chap-Component_Reference-Actions.xml
===================================================================
---
modules/docs/trunk/Component_Reference/src/main/docbook/en-US/chap-Component_Reference-Actions.xml 2010-11-10
22:36:12 UTC (rev 20025)
+++
modules/docs/trunk/Component_Reference/src/main/docbook/en-US/chap-Component_Reference-Actions.xml 2010-11-11
07:15:57 UTC (rev 20026)
@@ -6,6 +6,50 @@
<para>
This chapter details the basic components that respond to a user action and submit an
Ajax request.
</para>
+
+ <section id="sect-Component_Reference-Actions-a4jajax">
+ <title><sgmltag><a4j:ajax></sgmltag></title>
+ <para>
+ The <sgmltag><a4j:ajax></sgmltag> component allows Ajax
capability to be added to any non-Ajax component. It is placed as a direct child to the
component that requires Ajax support. The
<sgmltag><a4j:ajax></sgmltag> component uses the common
attributes listed in <xref
linkend="chap-Component_Reference-Common_Ajax_attributes" />.
+ </para>
+ <note>
+ <title>Attaching JavaScript functions</title>
+ <para>
+ When attaching the <sgmltag><a4j:ajax></sgmltag> component
to non-Ajax JavaServer Faces command components, such as
<sgmltag><h:commandButton></sgmltag> and
<sgmltag><h:commandLink></sgmltag>, it is important to set
<code>disabledDefault="true"</code>. If this attribute is not set, a
non-Ajax request is sent after the Ajax request and the page is refreshed unexpectedly.
+ </para>
+ </note>
+ <example id="exam-Component_Reference-a4jajax-a4jajax_example">
+ <title><sgmltag><a4j:ajax></sgmltag>
example</title>
+ <programlisting language="XML" role="XML"><xi:include
href="extras/exam-Component_Reference-a4jajax-a4jajax_example.xml_sample"
parse="text"
xmlns:xi="http://www.w3.org/2001/XInclude"
/></programlisting>
+ </example>
+
+ <section id="sect-Component_Reference-a4jajax-Reference_data">
+ <title>Reference data</title>
+ <itemizedlist>
+ <listitem>
+ <para>
+ <parameter>component-type</parameter>:
<classname>org.ajax4jsf.Ajax</classname>
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ <parameter>component-class</parameter>:
<classname>org.ajax4jsf.component.html.HtmlAjaxSupport</classname>
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ <parameter>component-family</parameter>:
<classname>org.ajax4jsf.Ajax</classname>
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ <parameter>renderer-type</parameter>:
<classname>org.ajax4jsf.components.AjaxSupportRenderer</classname>
+ </para>
+ </listitem>
+ </itemizedlist>
+ </section>
+ </section>
+
<section id="sect-Component_Reference-Actions-a4jactionParam">
<title><sgmltag><a4j:actionParam></sgmltag></title>
<para>
@@ -544,49 +588,6 @@
</itemizedlist>
</section>
</section>
-
- <section id="sect-Component_Reference-Actions-a4jajax">
- <title><sgmltag><a4j:ajax></sgmltag></title>
- <para>
- The <sgmltag><a4j:ajax></sgmltag> component allows Ajax
capability to be added to any non-Ajax component. It is placed as a direct child to the
component that requires Ajax support. The
<sgmltag><a4j:ajax></sgmltag> component uses the common
attributes listed in <xref
linkend="chap-Component_Reference-Common_Ajax_attributes" />.
- </para>
- <note>
- <title>Attaching JavaScript functions</title>
- <para>
- When attaching the <sgmltag><a4j:ajax></sgmltag> component
to non-Ajax JavaServer Faces command components, such as
<sgmltag><h:commandButton></sgmltag> and
<sgmltag><h:commandLink></sgmltag>, it is important to set
<code>disabledDefault="true"</code>. If this attribute is not set, a
non-Ajax request is sent after the Ajax request and the page is refreshed unexpectedly.
- </para>
- </note>
- <example id="exam-Component_Reference-a4jajax-a4jajax_example">
- <title><sgmltag><a4j:ajax></sgmltag>
example</title>
- <programlisting language="XML" role="XML"><xi:include
href="extras/exam-Component_Reference-a4jajax-a4jajax_example.xml_sample"
parse="text"
xmlns:xi="http://www.w3.org/2001/XInclude"
/></programlisting>
- </example>
-
- <section id="sect-Component_Reference-a4jajax-Reference_data">
- <title>Reference data</title>
- <itemizedlist>
- <listitem>
- <para>
- <parameter>component-type</parameter>:
<classname>org.ajax4jsf.Ajax</classname>
- </para>
- </listitem>
- <listitem>
- <para>
- <parameter>component-class</parameter>:
<classname>org.ajax4jsf.component.html.HtmlAjaxSupport</classname>
- </para>
- </listitem>
- <listitem>
- <para>
- <parameter>component-family</parameter>:
<classname>org.ajax4jsf.Ajax</classname>
- </para>
- </listitem>
- <listitem>
- <para>
- <parameter>renderer-type</parameter>:
<classname>org.ajax4jsf.components.AjaxSupportRenderer</classname>
- </para>
- </listitem>
- </itemizedlist>
- </section>
- </section>
</chapter>
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 2010-11-10
22:36:12 UTC (rev 20025)
+++
modules/docs/trunk/Component_Reference/src/main/docbook/en-US/chap-Component_Reference-Tables_and_grids.xml 2010-11-11
07:15:57 UTC (rev 20026)
@@ -1181,16 +1181,88 @@
<section
id="sect-Component_Reference-Tables_and_grids-Table_filtering">
<title>Table filtering</title>
+ <!-- In development notification -->
+ <important>
+ <title>Documentation in development</title>
+ <para>
+ This section is currently under development. Any features it describes may not be
available in the current release of RichFaces.
+ </para>
+ </important>
+
+ <!-- TODO: not in M4
<para>
- Under development.
+ Tables entries can be filtered by the user using 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>
+ The built-in filtering abilities of the
<sgmltag><rich:column></sgmltag> component allow the user to
enter text as a filtering value. The table displays only those entries that begin with the
filter value.
+ </para>
+ <para>
+ Set the <varname>filterValue</varname> attribute to point to the value
used to filter the column. This can be either an initial filtering value on the page, or a
value binding on the server. The <varname>filterValue</varname> value is then
used with the JavaScript <function>startsWith()</function> method to filter
the column entries based on the data specified with the
<varname>filterBy</varname> attribute. Expressions in the
<varname>filterBy</varname> attribute must refer to the variable declared in
the table's <varname>var</varname> attribute, which is used to fill the
contents of the table.
+ </para>
+ <para>
+ The filter is processed and the table is rendered when the
<literal>onblur</literal> event occurs for the column. This can be changed by
defining a different event with the <varname>filterEvent</varname> attribute.
For example, to implement live updating such that the filter refreshes after every
keystroke, set <code>filterEvent="onkeyup"</code>.
+ </para>
+ <example
id="exam-Component_Reference-Table_filtering-Basic_filtering">
+ <title>Basic filtering</title>
+ <programlisting language="XML" role="XML"><xi:include
parse="text"
href="extras/exam-Component_Reference-Table_filtering-Basic_filtering.xml_sample"
xmlns:xi="http://www.w3.org/2001/XInclude" /></programlisting>
+ <para>
+ The example uses the basic filtering method on both columns in the table.
+ </para>
+ <mediaobject>
+ <imageobject>
+ <imagedata
fileref="images/figu-Component_Reference-Table_filtering-Basic_filtering.png"
format="PNG" />
+ </imageobject>
+ <textobject>
+ <para>
+ A table of state capitals filtered by states beginning with the letter
"<wordasword>n</wordasword>".
+ </para>
+ </textobject>
+ </mediaobject>
+ </example>
+ </section>
+ <section
id="sect-Component_Reference-Table_filtering-External_filtering">
+ <title>External filtering</title>
+ <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.
+ </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.
+ </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>
+ <para>
+ The example uses a filter expression on the first column and a filter method on the
second column.
+ </para>
+ <mediaobject>
+ <imageobject>
+ <imagedata
fileref="images/figu-Component_Reference-Table_filtering-External_filtering.png"
format="PNG" />
+ </imageobject>
+ <textobject>
+ <para>
+ A table of state capitals filtered by states beginning with the letter
"<wordasword>a</wordasword>", further filtered to those states in
the GMT-5 time zone.
+ </para>
+ </textobject>
+ </mediaobject>
+ </example>
+ </section>
+ -->
</section>
<section id="sect-Component_Reference-Tables_and_grids-Table_sorting">
<title>Table sorting</title>
- <para>
- Under development.
- </para>
+ <!-- In development notification -->
+ <important>
+ <title>Documentation in development</title>
+ <para>
+ This section is currently under development. Any features it describes may not be
available in the current release of RichFaces.
+ </para>
+ </important>
</section>
</chapter>
Added:
modules/docs/trunk/Component_Reference/src/main/docbook/en-US/extras/exam-Component_Reference-Table_filtering-Basic_filtering.xml_sample
===================================================================
---
modules/docs/trunk/Component_Reference/src/main/docbook/en-US/extras/exam-Component_Reference-Table_filtering-Basic_filtering.xml_sample
(rev 0)
+++
modules/docs/trunk/Component_Reference/src/main/docbook/en-US/extras/exam-Component_Reference-Table_filtering-Basic_filtering.xml_sample 2010-11-11
07:15:57 UTC (rev 20026)
@@ -0,0 +1,18 @@
+<rich:dataTable value="#{capitalsBean.capitals}" var="cap">
+ <f:facet name="header">
+ <rich:column>
+ <h:outputText value="State Name">
+ </rich:column>
+ <rich:column>
+ <h:outputText value="State Capital">
+ </rich:column>
+ </f:facet>
+ <rich:column filterValue="#{capitalsBean.currentStateFilterValue}"
+ filterBy="#{cap.state}" filterEvent="onkeyup">
+ <h:outputText value="#{cap.state}"/>
+ </rich:column>
+ <rich:column filterValue="#{capitalsBean.currentNameFilterValue}"
+ filterBy="#{cap.name}" filterEvent="onkeyup">
+ <h:outputText value="#{cap.name}"/>
+ </rich:column>
+</rich:dataTable>
Added:
modules/docs/trunk/Component_Reference/src/main/docbook/en-US/extras/exam-Component_Reference-Table_filtering-External_filtering.xml_sample
===================================================================
---
modules/docs/trunk/Component_Reference/src/main/docbook/en-US/extras/exam-Component_Reference-Table_filtering-External_filtering.xml_sample
(rev 0)
+++
modules/docs/trunk/Component_Reference/src/main/docbook/en-US/extras/exam-Component_Reference-Table_filtering-External_filtering.xml_sample 2010-11-11
07:15:57 UTC (rev 20026)
@@ -0,0 +1,29 @@
+<rich:dataTable value="#{capitalsBean.capitals}" var="cap"
id="table">
+ <f:facet name="header">
+ <rich:column>
+ <h:outputText value="State Name">
+ </rich:column>
+ <rich:column>
+ <h:outputText value="State Time Zone">
+ </rich:column>
+ </f:facet>
+ <rich:column filterMethod="#{filteringBean.filterStates}">
+ <f:facet name="header">
+ <h:inputText value="#{filteringBean.filterValue}"
id="input">
+ <a4j:ajax event="onkeyup" render="table"
+ ignoreDupResponses="true" requestDelay="700"/>
+ </h:inputText>
+ </f:facet>
+ <h:outputText value="#{cap.state}"/>
+ </rich:column>
+ <rich:column filterExpression=
+ "#{fn:containsIgnoreCase(cap.timeZone, filteringBean.filterZone)}">
+ <f:facet name="header">
+ <h:selectOneMenu value="#{filteringBean.filterZone}">
+ <f:selectItems value="#{filteringBean.filterZones}" />
+ <a4j:ajax event="onchange" render="table" />
+ </h:selectOneMenu>
+ </f:facet>
+ <h:outputText value="#{cap.timeZone}"/>
+ </rich:column>
+</rich:dataTable>
Modified:
modules/docs/trunk/Component_Reference/src/main/docbook/en-US/extras/exam-Component_Reference-a4jajax-a4jajax_example.xml_sample
===================================================================
---
modules/docs/trunk/Component_Reference/src/main/docbook/en-US/extras/exam-Component_Reference-a4jajax-a4jajax_example.xml_sample 2010-11-10
22:36:12 UTC (rev 20025)
+++
modules/docs/trunk/Component_Reference/src/main/docbook/en-US/extras/exam-Component_Reference-a4jajax-a4jajax_example.xml_sample 2010-11-11
07:15:57 UTC (rev 20026)
@@ -1,6 +1,6 @@
<h:panelGrid columns="2">
<h:inputText id="myinput" value="#{userBean.name}">
- <a4j:ajax event="onkeyup" reRender="outtext" />
+ <a4j:ajax event="onkeyup" render="outtext" />
</h:inputText>
<h:outputText id="outtext" value="#{userBean.name}" />
</h:panelGrid>
Added:
modules/docs/trunk/Component_Reference/src/main/docbook/en-US/images/figu-Component_Reference-Table_filtering-Basic_filtering.png
===================================================================
(Binary files differ)
Property changes on:
modules/docs/trunk/Component_Reference/src/main/docbook/en-US/images/figu-Component_Reference-Table_filtering-Basic_filtering.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added:
modules/docs/trunk/Component_Reference/src/main/docbook/en-US/images/figu-Component_Reference-Table_filtering-External_filtering.png
===================================================================
(Binary files differ)
Property changes on:
modules/docs/trunk/Component_Reference/src/main/docbook/en-US/images/figu-Component_Reference-Table_filtering-External_filtering.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream