Author: ilya_shaikovsky
Date: 2008-03-24 09:21:20 -0400 (Mon, 24 Mar 2008)
New Revision: 7109
Modified:
trunk/samples/richfaces-demo/src/main/webapp/richfaces/filteringFeature.xhtml
trunk/samples/richfaces-demo/src/main/webapp/richfaces/sortingFeature.xhtml
trunk/samples/richfaces-demo/src/main/webapp/richfaces/sortingFeature/examples/simpleSingleSorting.xhtml
trunk/samples/richfaces-demo/src/main/webapp/richfaces/sortingFeature/externalSortingUsage.xhtml
trunk/samples/richfaces-demo/src/main/webapp/richfaces/sortingFeature/sortingUsage.xhtml
Log:
sorting feature descriptions added
Modified: trunk/samples/richfaces-demo/src/main/webapp/richfaces/filteringFeature.xhtml
===================================================================
---
trunk/samples/richfaces-demo/src/main/webapp/richfaces/filteringFeature.xhtml 2008-03-24
13:12:40 UTC (rev 7108)
+++
trunk/samples/richfaces-demo/src/main/webapp/richfaces/filteringFeature.xhtml 2008-03-24
13:21:20 UTC (rev 7109)
@@ -5,7 +5,7 @@
xmlns:f="http://java.sun.com/jsf/core"
xmlns:rich="http://richfaces.org/rich">
<ui:composition template="/templates/main.xhtml">
- <ui:define name="title">RichFaces - Open Source Rich JSF Components -
Filtering Feature</ui:define>
+ <ui:define name="title">RichFaces - Open Source Rich JSF Components -
Table Filtering Feature</ui:define>
<ui:define name="body">
<rich:tabPanel switchType="server"
value="#{componentNavigator.activeTab}" styleClass="top_tab"
contentClass="content_tab" headerClass="header_tabs_class"
inactiveTabClass="inactive_tab" activeTabClass="active_tab">
<rich:tab label="Built-In Filtering Usage">
Modified:
trunk/samples/richfaces-demo/src/main/webapp/richfaces/sortingFeature/examples/simpleSingleSorting.xhtml
===================================================================
---
trunk/samples/richfaces-demo/src/main/webapp/richfaces/sortingFeature/examples/simpleSingleSorting.xhtml 2008-03-24
13:12:40 UTC (rev 7108)
+++
trunk/samples/richfaces-demo/src/main/webapp/richfaces/sortingFeature/examples/simpleSingleSorting.xhtml 2008-03-24
13:21:20 UTC (rev 7109)
@@ -10,28 +10,32 @@
}
</style>
<h:form>
- <rich:dataTable value="#{capitalsBean.capitals}" var="cap"
width="300px" columnClasses="center">
+ <rich:dataTable value="#{capitalsBean.capitals}" var="cap"
width="300px" columnClasses="center"
+ rows="15">
<f:facet name="header">
<h:outputText value="Sorting Example"/>
</f:facet>
- <rich:column>
- <f:facet name="header">
- <h:outputText value="State Flag"></h:outputText>
- </f:facet>
- <h:graphicImage value="#{cap.stateFlag}"/>
- </rich:column>
<rich:column sortBy="#{cap.state}">
<f:facet name="header">
- <h:outputText value="State Name"></h:outputText>
+ <h:outputText value="State Name"/>
</f:facet>
- <h:outputText value="#{cap.state}"></h:outputText>
+ <h:outputText value="#{cap.state}"/>
</rich:column>
<rich:column sortBy="#{cap.name}">
<f:facet name="header">
- <h:outputText value="State Capital"></h:outputText>
+ <h:outputText value="State Capital"/>
</f:facet>
<h:outputText value="#{cap.name}"/>
</rich:column>
+ <rich:column>
+ <f:facet name="header">
+ <h:outputText value="Time Zone"/>
+ </f:facet>
+ <h:outputText value="#{cap.timeZone}"/>
+ </rich:column>
+ <f:facet name="footer">
+ <rich:datascroller/>
+ </f:facet>
</rich:dataTable>
</h:form>
</ui:composition>
\ No newline at end of file
Modified:
trunk/samples/richfaces-demo/src/main/webapp/richfaces/sortingFeature/externalSortingUsage.xhtml
===================================================================
---
trunk/samples/richfaces-demo/src/main/webapp/richfaces/sortingFeature/externalSortingUsage.xhtml 2008-03-24
13:12:40 UTC (rev 7108)
+++
trunk/samples/richfaces-demo/src/main/webapp/richfaces/sortingFeature/externalSortingUsage.xhtml 2008-03-24
13:21:20 UTC (rev 7109)
@@ -8,21 +8,35 @@
<ui:define name="sample">
<p>
- SHORT DESCRIPTION
+ In order to customize built-in sorting you just need:
</p>
-
+ <ul>
+ <li>
+ Turn <b>selfSorted</b> on the columns to "false"
+ </li>
+ <li>
+ Bind <b>sortOrder</b> attributes on the columns to the bean properties.
+ </li>
+ <li>
+ Manage the bindings with values from
<i>org.richfaces.model.Ordering</i> enum.
+ </li>
+ <li>
+ If the sorting is multiple - fill the <b>sortPriorities</b> list with
column ids
+ in the order the columns should be sorted.
+ </li>
+ </ul>
+ <p>
+ Try next example. Just change sorting order on the table through
+ attributes and it automatically resort its content. In order to perform sorting
+ just choose the sorting properties, sorting direction and press sort button:
+ </p>
<div class="sample-container" >
- <ui:include
src="/richfaces/sortingFeatures/examples/externalMultipleSorting.xhtml"/>
+ <ui:include
src="/richfaces/sortingFeature/examples/externalMultipleSorting.xhtml"/>
<ui:include src="/templates/include/sourceview.xhtml">
<ui:param name="sourcepath"
value="/richfaces/sortingFeature/examples/externalMultipleSorting.xhtml"/>
</ui:include>
</div>
-
- <p>
- DESCRIPTION
- </p>
-
</ui:define>
</ui:composition>
Modified:
trunk/samples/richfaces-demo/src/main/webapp/richfaces/sortingFeature/sortingUsage.xhtml
===================================================================
---
trunk/samples/richfaces-demo/src/main/webapp/richfaces/sortingFeature/sortingUsage.xhtml 2008-03-24
13:12:40 UTC (rev 7108)
+++
trunk/samples/richfaces-demo/src/main/webapp/richfaces/sortingFeature/sortingUsage.xhtml 2008-03-24
13:21:20 UTC (rev 7109)
@@ -7,21 +7,51 @@
<ui:composition template="/templates/component-sample.xhtml">
<ui:define name="sample">
+ <p><b>
+ Rich Data Table</b> has columns <b>sorting feature</b> built-in.
Simplest way to add sorting
+ capability is to define <b>sortBy </b>attribute at column you need to be
sorted.
+ </p>
<p>
- SHORT DESCRIPTION
+ In this attribute you should define iterable object property which should be
+ used when sorting performed.
</p>
-
- <div class="sample-container" >
-
- <ui:include
src="/richfaces/sortingFeature/examples/simpleSingleSorting.xhtml"/>
- <ui:include src="/templates/include/sourceview.xhtml">
- <ui:param name="sourcepath"
value="/richfaces/sortingFeature/examples/simpleSingleSorting.xhtml"/>
- </ui:include>
- </div>
-
<p>
- DESCRIPTION
+ In this example you could see that two first columns sorted after corresponding
+ header click.
</p>
+ <h:panelGrid columns="2">
+ <div class="sample-container" jsfc="h:panelGroup"
layout="block">
+ <ui:include
src="/richfaces/sortingFeature/examples/simpleSingleSorting.xhtml"/>
+ <ui:include src="/templates/include/sourceview.xhtml">
+ <ui:param name="sourcepath"
value="/richfaces/sortingFeature/examples/simpleSingleSorting.xhtml"/>
+ </ui:include>
+ </div>
+ <div jsfc="h:panelGroup" layout="block">
+ <p>
+ Next attributes could be defined to manage simple built-in sorting:
+ </p>
+ <ul>
+ <li>
+ <b>sortMode</b> - attribute of <b>rich:dataTable</b>
which could be defined as
+ "single"(Default) and "multiple". If multiple sorting defined
-
+ previous sorting will not be reseted. Column will be sorted
+ </li>
+ <li><b>sortOrder</b> - attribute of
<b>rich:column</b>
+ allows to set initial sorting on the column.
+ (Additional ways of usage to customize sorting described at "External
+ Sorting" tab). Possible values are "ASCENDING",
"DESCENDING" and
+ "UNSORTED"(default)
+ </li>
+ <li>
+ <b>selfSorted</b> attribute of <b>brich:column</b> which
defines
+ if the table will make header clickable and if click on the
+ header will call sorting request.
+ Default value is "true". In order to use custom sorting mechanism
+ use value "false" for this attribute.
+ </li>
+ </ul>
+ </div>
+ </h:panelGrid>
</ui:define>
Modified: trunk/samples/richfaces-demo/src/main/webapp/richfaces/sortingFeature.xhtml
===================================================================
--- trunk/samples/richfaces-demo/src/main/webapp/richfaces/sortingFeature.xhtml 2008-03-24
13:12:40 UTC (rev 7108)
+++ trunk/samples/richfaces-demo/src/main/webapp/richfaces/sortingFeature.xhtml 2008-03-24
13:21:20 UTC (rev 7109)
@@ -5,7 +5,7 @@
xmlns:f="http://java.sun.com/jsf/core"
xmlns:rich="http://richfaces.org/rich">
<ui:composition template="/templates/main.xhtml">
- <ui:define name="title">RichFaces - Open Source Rich JSF Components -
Sorting and Filtering Features</ui:define>
+ <ui:define name="title">RichFaces - Open Source Rich JSF Components -
Table Sorting Feature</ui:define>
<ui:define name="body">
<rich:tabPanel switchType="server" styleClass="top_tab"
contentClass="content_tab" headerClass="header_tabs_class"
inactiveTabClass="inactive_tab" activeTabClass="active_tab">
<rich:tab label="Built-in Sorting Feature">