Author: lfryc(a)redhat.com
Date: 2010-11-17 04:34:09 -0500 (Wed, 17 Nov 2010)
New Revision: 20065
Added:
modules/tests/metamer/trunk/application/src/main/webapp/components/richDataTable/sorting-using-column.xhtml
modules/tests/metamer/trunk/application/src/main/webapp/components/richDataTable/sorting-using-component-control.xhtml
Removed:
modules/tests/metamer/trunk/application/src/main/webapp/components/richDataTable/sorting.xhtml
Modified:
modules/tests/metamer/trunk/application/src/main/webapp/components/richDataTable/list.xhtml
modules/tests/metamer/trunk/application/src/main/webapp/components/richDataTable/simple.xhtml
Log:
rich:dataTable - sorting divided to two samples: sorting using component control and
sorting using column (RFPL-912)
Modified:
modules/tests/metamer/trunk/application/src/main/webapp/components/richDataTable/list.xhtml
===================================================================
---
modules/tests/metamer/trunk/application/src/main/webapp/components/richDataTable/list.xhtml 2010-11-17
09:21:53 UTC (rev 20064)
+++
modules/tests/metamer/trunk/application/src/main/webapp/components/richDataTable/list.xhtml 2010-11-17
09:34:09 UTC (rev 20065)
@@ -49,9 +49,13 @@
<span style="color: red">TODO will be used with various
types of input and command components as soon as available</span>
</metamer:testPageLink>
- <metamer:testPageLink id="sorting" outcome="sorting"
value="Table Sorting">
- Page that contains sortable <b>rich:dataTable</b> (with model
containing capitals) and input boxes for all its attributes.
+ <metamer:testPageLink id="sorting-using-component-control"
outcome="sorting-using-component-control" value="Table Sorting - Component
Control">
+ <b>rich:dataTable</b> (with model containing states and
capitals) sortable by <b>rich:componentControl</b>.
</metamer:testPageLink>
+
+ <metamer:testPageLink id="sorting-using-column"
outcome="sorting-using-column" value="Table Sorting - Column
based">
+ <b>rich:dataTable</b> (with model containing states and
capitals) custom sorting by <b>rich:column</b>'s attribute @sortBy,
@sortOrder.
+ </metamer:testPageLink>
<metamer:testPageLink id="filtering"
outcome="filtering" value="Table filtering">
Page that contains filterable <b>rich:dataTable</b> (with
model containing capitals) and input boxes for all its attributes.
Modified:
modules/tests/metamer/trunk/application/src/main/webapp/components/richDataTable/simple.xhtml
===================================================================
---
modules/tests/metamer/trunk/application/src/main/webapp/components/richDataTable/simple.xhtml 2010-11-17
09:21:53 UTC (rev 20064)
+++
modules/tests/metamer/trunk/application/src/main/webapp/components/richDataTable/simple.xhtml 2010-11-17
09:34:09 UTC (rev 20065)
@@ -47,7 +47,7 @@
</ui:define>
<ui:define name="component">
-
+
<rich:dataTable id="richDataTable"
filterVar="#{richDataTableBean.attributes['filterVar'].value}"
filteringListeners="#{richDataTableBean.attributes['filteringListeners'].value}"
@@ -110,8 +110,11 @@
</ui:define>
<ui:define name="outOfTemplateAfter">
+
<h:commandButton id="sortStatesButton" value="sort
states">
- <rich:componentControl event="click"
target="richDataTable" operation="sort"/>
+ <rich:componentControl event="click"
target="richDataTable" operation="sort">
+ <f:param value="columnState" />
+ </rich:componentControl>
</h:commandButton>
<h:commandButton id="sortCapitalsButton" value="sort
capitals">
@@ -119,7 +122,13 @@
<f:param value="columnCapital" />
</rich:componentControl>
</h:commandButton>
-
+
+ <br/><br/>
+
+ <h:commandButton id="sortTableButton" value="sort table">
+ <rich:componentControl event="click"
target="richDataTable" operation="sort" />
+ </h:commandButton>
+
<br/><br/>
<metamer:attributes value="#{richDataTableBean.attributes}"
id="attributes" />
Copied:
modules/tests/metamer/trunk/application/src/main/webapp/components/richDataTable/sorting-using-column.xhtml
(from rev 20064,
modules/tests/metamer/trunk/application/src/main/webapp/components/richDataTable/sorting.xhtml)
===================================================================
---
modules/tests/metamer/trunk/application/src/main/webapp/components/richDataTable/sorting-using-column.xhtml
(rev 0)
+++
modules/tests/metamer/trunk/application/src/main/webapp/components/richDataTable/sorting-using-column.xhtml 2010-11-17
09:34:09 UTC (rev 20065)
@@ -0,0 +1,114 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html
xmlns="http://www.w3.org/1999/xhtml"
xmlns:h="http://java.sun.com/jsf/html"
xmlns:f="http://java.sun.com/jsf/core"
+
xmlns:ui="http://java.sun.com/jsf/facelets"
xmlns:a4j="http://richfaces.org/a4j"
+
xmlns:metamer="http://java.sun.com/jsf/composite/metamer"
xmlns:rich="http://richfaces.org/rich">
+
+ <!--
+JBoss, Home of Professional Open Source
+Copyright 2010, 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.
+ -->
+
+ <ui:composition template="/templates/template.xhtml">
+
+ <ui:define name="head">
+ <f:metadata>
+ <f:viewParam name="templates"
value="#{templateBean.templates}">
+ <f:converter converterId="templatesListConverter" />
+ </f:viewParam>
+ </f:metadata>
+ <h:outputStylesheet library="css"
name="richDataTable.css"/>
+ </ui:define>
+
+ <ui:define name="outOfTemplateBefore">
+ <br/>
+ <h:outputText value="Show data in table: " />
+ <h:selectBooleanCheckbox id="noDataCheckbox"
value="#{richDataTableBean.state}">
+ <a4j:ajax render="richDataTable scroller1"/>
+ </h:selectBooleanCheckbox>
+ <br/><br/>
+ <rich:dataScroller id="scroller1" for="richDataTable"
page="#{richDataTableBean.page}" maxPages="7"
render="richDataTable"/>
+ </ui:define>
+
+ <ui:define name="component">
+
+ <rich:dataTable id="richDataTable"
+
filterVar="#{richDataTableBean.attributes['filterVar'].value}"
+
filteringListeners="#{richDataTableBean.attributes['filteringListeners'].value}"
+
first="#{richDataTableBean.attributes['first'].value}"
+
iterationState="#{richDataTableBean.attributes['iterationState'].value}"
+
iterationStatusVar="#{richDataTableBean.attributes['iterationStatusVar'].value}"
+
keepSaved="#{richDataTableBean.attributes['keepSaved'].value}"
+
noDataLabel="#{richDataTableBean.attributes['noDataLabel'].value}"
+
relativeRowIndex="#{richDataTableBean.attributes['relativeRowIndex'].value}"
+
rendered="#{richDataTableBean.attributes['rendered'].value}"
+
rowAvailable="#{richDataTableBean.attributes['rowAvailable'].value}"
+
rowCount="#{richDataTableBean.attributes['rowCount'].value}"
+
rowData="#{richDataTableBean.attributes['rowData'].value}"
+
rowIndex="#{richDataTableBean.attributes['rowIndex'].value}"
+
rowKey="#{richDataTableBean.attributes['rowKey'].value}"
+
rowKeyConverter="#{richDataTableBean.attributes['rowKeyConverter'].value}"
+
rows="#{richDataTableBean.attributes['rows'].value}"
+
sortMode="#{richDataTableBean.attributes['sortMode'].value}"
+
sortPriority="#{richDataTableBean.attributes['sortPriority'].value}"
+
sortingListeners="#{richDataTableBean.attributes['sortingListeners'].value}"
+ value="#{richDataTableBean.state ? model.capitals :
null}"
+ var="record"
+ >
+
+ <f:facet name="noData">
+ <h:outputText value="There is no data."
style="color: red;"/>
+ </f:facet>
+
+ <rich:column id="columnState"
sortBy="#{record.state}"
sortOrder="#{richDataTableBean.statesOrder}">
+ <f:facet name="header">
+ <a4j:commandLink id="columnHeaderState"
value="State" render="richDataTable"
action="#{richDataTableBean.sortByStates}"/>
+ </f:facet>
+
+ <h:outputText value="#{record.state}" />
+ <f:facet name="footer">
+ <h:outputText id="columnFooterState"
value="State" />
+ </f:facet>
+ </rich:column>
+
+ <rich:column id="columnCapital"
sortBy="#{record.name}" sortOrder="#{richDataTableBean.capitalsOrder}"
sortingListeners="#{richDataTableBean.sortingListener}">
+ <f:facet name="header">
+ <a4j:commandLink id="columnHeaderCapital"
value="Capital" render="richDataTable"
action="#{richDataTableBean.sortByCapitals}"/>
+ </f:facet>
+
+ <h:outputText value="#{record.name}" />
+ <f:facet name="footer">
+ <h:outputText id="columnFooterCapital"
value="Capital" />
+ </f:facet>
+ </rich:column>
+
+ <f:facet name="footer">
+ <rich:dataScroller id="scroller2"
for="richDataTable" page="#{richDataTableBean.page}"
maxPages="7" render="richDataTable" />
+ </f:facet>
+
+ </rich:dataTable>
+ </ui:define>
+
+ <ui:define name="outOfTemplateAfter">
+ <metamer:attributes value="#{richDataTableBean.attributes}"
id="attributes" />
+ </ui:define>
+
+ </ui:composition>
+</html>
\ No newline at end of file
Copied:
modules/tests/metamer/trunk/application/src/main/webapp/components/richDataTable/sorting-using-component-control.xhtml
(from rev 20064,
modules/tests/metamer/trunk/application/src/main/webapp/components/richDataTable/sorting.xhtml)
===================================================================
---
modules/tests/metamer/trunk/application/src/main/webapp/components/richDataTable/sorting-using-component-control.xhtml
(rev 0)
+++
modules/tests/metamer/trunk/application/src/main/webapp/components/richDataTable/sorting-using-component-control.xhtml 2010-11-17
09:34:09 UTC (rev 20065)
@@ -0,0 +1,134 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html
xmlns="http://www.w3.org/1999/xhtml"
xmlns:h="http://java.sun.com/jsf/html"
xmlns:f="http://java.sun.com/jsf/core"
+
xmlns:ui="http://java.sun.com/jsf/facelets"
xmlns:a4j="http://richfaces.org/a4j"
+
xmlns:metamer="http://java.sun.com/jsf/composite/metamer"
xmlns:rich="http://richfaces.org/rich">
+
+ <!--
+JBoss, Home of Professional Open Source
+Copyright 2010, 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.
+ -->
+
+ <ui:composition template="/templates/template.xhtml">
+
+ <ui:define name="head">
+ <f:metadata>
+ <f:viewParam name="templates"
value="#{templateBean.templates}">
+ <f:converter converterId="templatesListConverter" />
+ </f:viewParam>
+ </f:metadata>
+ <h:outputStylesheet library="css"
name="richDataTable.css"/>
+ </ui:define>
+
+ <ui:define name="outOfTemplateBefore">
+ <br/>
+ <h:outputText value="Show data in table: " />
+ <h:selectBooleanCheckbox id="noDataCheckbox"
value="#{richDataTableBean.state}">
+ <a4j:ajax render="richDataTable scroller1"/>
+ </h:selectBooleanCheckbox>
+ <br/><br/>
+ <rich:dataScroller id="scroller1" for="richDataTable"
page="#{richDataTableBean.page}" maxPages="7"
render="richDataTable"/>
+ </ui:define>
+
+ <ui:define name="component">
+
+ <rich:dataTable id="richDataTable"
+
filterVar="#{richDataTableBean.attributes['filterVar'].value}"
+
filteringListeners="#{richDataTableBean.attributes['filteringListeners'].value}"
+
first="#{richDataTableBean.attributes['first'].value}"
+
iterationState="#{richDataTableBean.attributes['iterationState'].value}"
+
iterationStatusVar="#{richDataTableBean.attributes['iterationStatusVar'].value}"
+
keepSaved="#{richDataTableBean.attributes['keepSaved'].value}"
+
noDataLabel="#{richDataTableBean.attributes['noDataLabel'].value}"
+
relativeRowIndex="#{richDataTableBean.attributes['relativeRowIndex'].value}"
+
rendered="#{richDataTableBean.attributes['rendered'].value}"
+
rowAvailable="#{richDataTableBean.attributes['rowAvailable'].value}"
+
rowCount="#{richDataTableBean.attributes['rowCount'].value}"
+
rowData="#{richDataTableBean.attributes['rowData'].value}"
+
rowIndex="#{richDataTableBean.attributes['rowIndex'].value}"
+
rowKey="#{richDataTableBean.attributes['rowKey'].value}"
+
rowKeyConverter="#{richDataTableBean.attributes['rowKeyConverter'].value}"
+
rows="#{richDataTableBean.attributes['rows'].value}"
+
sortMode="#{richDataTableBean.attributes['sortMode'].value}"
+
sortPriority="#{richDataTableBean.attributes['sortPriority'].value}"
+
sortingListeners="#{richDataTableBean.attributes['sortingListeners'].value}"
+ value="#{richDataTableBean.state ? model.capitals :
null}"
+ var="record"
+ >
+
+ <f:facet name="noData">
+ <h:outputText value="There is no data."
style="color: red;"/>
+ </f:facet>
+
+ <rich:column id="columnState"
sortBy="#{record.state}"
sortOrder="#{richDataTableBean.statesOrder}">
+ <f:facet name="header">
+ State
+ </f:facet>
+
+ <h:outputText value="#{record.state}" />
+ <f:facet name="footer">
+ <h:outputText id="columnFooterState"
value="State" />
+ </f:facet>
+ </rich:column>
+
+ <rich:column id="columnCapital"
sortBy="#{record.name}"
sortOrder="#{richDataTableBean.capitalsOrder}">
+ <f:facet name="header">
+ Capital
+ </f:facet>
+
+ <h:outputText value="#{record.name}" />
+ <f:facet name="footer">
+ <h:outputText id="columnFooterCapital"
value="Capital" />
+ </f:facet>
+ </rich:column>
+
+ <f:facet name="footer">
+ <rich:dataScroller id="scroller2"
for="richDataTable" page="#{richDataTableBean.page}"
maxPages="7" render="richDataTable" />
+ </f:facet>
+
+ </rich:dataTable>
+ </ui:define>
+
+ <ui:define name="outOfTemplateAfter">
+ <h:commandButton id="sortStatesButton" value="sort
state">
+ <rich:componentControl event="click"
target="richDataTable" operation="sort">
+ <f:param value="columnState" />
+ </rich:componentControl>
+ </h:commandButton>
+
+ <h:commandButton id="sortCapitalsButton" value="sort
capital">
+ <rich:componentControl event="click"
target="richDataTable" operation="sort">
+ <f:param value="columnCapital" />
+ </rich:componentControl>
+ </h:commandButton>
+
+ <br/><br/>
+
+ <h:commandButton id="sortTableButton" value="sort
table">
+ <rich:componentControl event="click"
target="richDataTable" operation="sort" />
+ </h:commandButton>
+
+ <br/><br/>
+
+ <metamer:attributes value="#{richDataTableBean.attributes}"
id="attributes" />
+ </ui:define>
+
+ </ui:composition>
+</html>
\ No newline at end of file
Deleted:
modules/tests/metamer/trunk/application/src/main/webapp/components/richDataTable/sorting.xhtml
===================================================================
---
modules/tests/metamer/trunk/application/src/main/webapp/components/richDataTable/sorting.xhtml 2010-11-17
09:21:53 UTC (rev 20064)
+++
modules/tests/metamer/trunk/application/src/main/webapp/components/richDataTable/sorting.xhtml 2010-11-17
09:34:09 UTC (rev 20065)
@@ -1,126 +0,0 @@
-<?xml version="1.0" encoding="UTF-8" ?>
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html
xmlns="http://www.w3.org/1999/xhtml"
xmlns:h="http://java.sun.com/jsf/html"
xmlns:f="http://java.sun.com/jsf/core"
-
xmlns:ui="http://java.sun.com/jsf/facelets"
xmlns:a4j="http://richfaces.org/a4j"
-
xmlns:metamer="http://java.sun.com/jsf/composite/metamer"
xmlns:rich="http://richfaces.org/rich">
-
- <!--
-JBoss, Home of Professional Open Source
-Copyright 2010, 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.
- -->
-
- <ui:composition template="/templates/template.xhtml">
-
- <ui:define name="head">
- <f:metadata>
- <f:viewParam name="templates"
value="#{templateBean.templates}">
- <f:converter converterId="templatesListConverter" />
- </f:viewParam>
- </f:metadata>
- <h:outputStylesheet library="css"
name="richDataTable.css"/>
- </ui:define>
-
- <ui:define name="outOfTemplateBefore">
- <br/>
- <h:outputText value="Show data in table: " />
- <h:selectBooleanCheckbox id="noDataCheckbox"
value="#{richDataTableBean.state}">
- <a4j:ajax render="richDataTable scroller1"/>
- </h:selectBooleanCheckbox>
- <br/><br/>
- <rich:dataScroller id="scroller1" for="richDataTable"
page="#{richDataTableBean.page}" maxPages="7"
render="richDataTable"/>
- </ui:define>
-
- <ui:define name="component">
-
- <rich:dataTable id="richDataTable"
-
filterVar="#{richDataTableBean.attributes['filterVar'].value}"
-
filteringListeners="#{richDataTableBean.attributes['filteringListeners'].value}"
-
first="#{richDataTableBean.attributes['first'].value}"
-
iterationState="#{richDataTableBean.attributes['iterationState'].value}"
-
iterationStatusVar="#{richDataTableBean.attributes['iterationStatusVar'].value}"
-
keepSaved="#{richDataTableBean.attributes['keepSaved'].value}"
-
noDataLabel="#{richDataTableBean.attributes['noDataLabel'].value}"
-
relativeRowIndex="#{richDataTableBean.attributes['relativeRowIndex'].value}"
-
rendered="#{richDataTableBean.attributes['rendered'].value}"
-
rowAvailable="#{richDataTableBean.attributes['rowAvailable'].value}"
-
rowCount="#{richDataTableBean.attributes['rowCount'].value}"
-
rowData="#{richDataTableBean.attributes['rowData'].value}"
-
rowIndex="#{richDataTableBean.attributes['rowIndex'].value}"
-
rowKey="#{richDataTableBean.attributes['rowKey'].value}"
-
rowKeyConverter="#{richDataTableBean.attributes['rowKeyConverter'].value}"
-
rows="#{richDataTableBean.attributes['rows'].value}"
-
sortMode="#{richDataTableBean.attributes['sortMode'].value}"
-
sortPriority="#{richDataTableBean.attributes['sortPriority'].value}"
-
sortingListeners="#{richDataTableBean.attributes['sortingListeners'].value}"
- value="#{richDataTableBean.state ? model.capitals :
null}"
- var="record"
- >
-
- <f:facet name="noData">
- <h:outputText value="There is no data."
style="color: red;"/>
- </f:facet>
-
- <rich:column id="columnState"
sortBy="#{record.state}"
sortOrder="#{richDataTableBean.statesOrder}">
- <f:facet name="header">
- <a4j:commandLink id="columnHeaderState"
value="State" render="richDataTable"
action="#{richDataTableBean.sortByStates}"/>
- </f:facet>
-
- <h:outputText value="#{record.state}" />
- <f:facet name="footer">
- <h:outputText id="columnFooterState"
value="State" />
- </f:facet>
- </rich:column>
-
- <rich:column id="columnCapital"
sortBy="#{record.name}" sortOrder="#{richDataTableBean.capitalsOrder}"
sortingListeners="#{richDataTableBean.sortingListener}">
- <f:facet name="header">
- <a4j:commandLink id="columnHeaderCapital"
value="Capital" render="richDataTable"
action="#{richDataTableBean.sortByCapitals}"/>
- </f:facet>
-
- <h:outputText value="#{record.name}" />
- <f:facet name="footer">
- <h:outputText id="columnFooterCapital"
value="Capital" />
- </f:facet>
- </rich:column>
-
- <f:facet name="footer">
- <rich:dataScroller id="scroller2"
for="richDataTable" page="#{richDataTableBean.page}"
maxPages="7" render="richDataTable" />
- </f:facet>
-
- </rich:dataTable>
- </ui:define>
-
- <ui:define name="outOfTemplateAfter">
- <h:commandButton id="sortStatesButton" value="sort
state">
- <rich:componentControl event="click"
target="richDataTable" operation="sort"/>
- </h:commandButton>
-
- <h:commandButton id="sortCapitalsButton" value="sort
capital">
- <rich:componentControl event="click"
target="richDataTable" operation="sort">
- <f:param value="columnCapital" />
- </rich:componentControl>
- </h:commandButton>
-
- <br/><br/>
-
- <metamer:attributes value="#{richDataTableBean.attributes}"
id="attributes" />
- </ui:define>
-
- </ui:composition>
-</html>
\ No newline at end of file