Author: abelevich
Date: 2010-02-19 11:57:18 -0500 (Fri, 19 Feb 2010)
New Revision: 16475
Modified:
root/examples-sandbox/trunk/components/tables/src/main/java/org/richfaces/demo/DataBean.java
root/examples-sandbox/trunk/components/tables/src/main/java/org/richfaces/demo/utils/EmployeeUtils.java
root/examples-sandbox/trunk/components/tables/src/main/webapp/home.xhtml
Log:
Modified:
root/examples-sandbox/trunk/components/tables/src/main/java/org/richfaces/demo/DataBean.java
===================================================================
---
root/examples-sandbox/trunk/components/tables/src/main/java/org/richfaces/demo/DataBean.java 2010-02-19
16:50:37 UTC (rev 16474)
+++
root/examples-sandbox/trunk/components/tables/src/main/java/org/richfaces/demo/DataBean.java 2010-02-19
16:57:18 UTC (rev 16475)
@@ -7,9 +7,7 @@
import org.richfaces.demo.model.Employee;
import org.richfaces.demo.utils.EmployeeUtils;
-import org.richfaces.event.ToggleEvent;
-import org.richfaces.model.visual.DataTableVisualModel;
-import org.richfaces.model.visual.SubTableVisualModel;
+import org.richfaces.event.SortingEvent;
@ManagedBean(name="dataBean")
@SessionScoped
@@ -17,17 +15,9 @@
private List<Employee> employeeList;
private boolean state = true;
+
- private DataTableVisualModel dataTableVisualModel;
-
- public DataTableVisualModel getDataTableVisualModel() {
- return dataTableVisualModel;
- }
- public void setDataTableVisualModel(DataTableVisualModel dataTableVisualModel) {
- this.dataTableVisualModel = dataTableVisualModel;
- }
-
public void setEmployeeList(List<Employee> employeeList) {
this.employeeList = employeeList;
}
@@ -46,5 +36,9 @@
public void setState(boolean state) {
this.state = state;
}
+
+ public void sortingListener(SortingEvent event) {
+ System.out.println(event.getSortOrder());
+ }
}
Modified:
root/examples-sandbox/trunk/components/tables/src/main/java/org/richfaces/demo/utils/EmployeeUtils.java
===================================================================
---
root/examples-sandbox/trunk/components/tables/src/main/java/org/richfaces/demo/utils/EmployeeUtils.java 2010-02-19
16:50:37 UTC (rev 16474)
+++
root/examples-sandbox/trunk/components/tables/src/main/java/org/richfaces/demo/utils/EmployeeUtils.java 2010-02-19
16:57:18 UTC (rev 16475)
@@ -18,7 +18,7 @@
addEmployeeToCollection(employeeList, "2Hideo Kodzima", "Vice
Prezident", "khideo(a)konami.jp", "AMicrosoft",
"419-615-2730", "Tokyo, Japan");
addEmployeeToCollection(employeeList, "3Stan Carpenter", "Lead
Designer", "scarpenter(a)ndogs.com", "AMicrosoft",
"714-647-3380", "Tokyo, Japan");
addEmployeeToCollection(employeeList, "Clement Gaudet", "Chief
Technology Officer", "cgaudet(a)rstar.com", "Rock Star",
"403-444-1100", "Canada");
- addEmployeeToCollection(employeeList, "Kazunori Yamauchi",
"CEO", "ykazunori(a)sony.jp", "Sony",
"410-561-4400", "Tokyo, Japan");
+ /*addEmployeeToCollection(employeeList, "Kazunori Yamauchi",
"CEO", "ykazunori(a)sony.jp", "Sony",
"410-561-4400", "Tokyo, Japan");
addEmployeeToCollection(employeeList, "Willis Aberg", "VP and
CIO", "waberg(a)evjscet.com", "Evj Scet",
"+046-155248000", "Tacoma, WA United States");
addEmployeeToCollection(employeeList, "Nick Acree", "Computer
Technician", "nacree(a)grifcity.com", "City Of Griffin",
"781-229-9599", "Houston, TX United States");
addEmployeeToCollection(employeeList, "RIchard L. Adams",
"Technology", "rladams(a)penergy.com", "Panhandle Energy",
"713-789-1400", "Valencia, CA United States");
@@ -1345,8 +1345,8 @@
addEmployeeToCollection(employeeList, "Derrik Khoo Sin Huat",
"CTO", "aksinhuat(a)aes.com", "The AES Corporation",
"864-233-4064", "Sydney, Australia");
addEmployeeToCollection(employeeList, "Rick Kelsven", "Network
Analyst", "rkelsven(a)rudny.com", "Rudny's Inc",
"208-356-4991", "Bangkok, Thailand");
+ */
-
return employeeList;
}
Modified: root/examples-sandbox/trunk/components/tables/src/main/webapp/home.xhtml
===================================================================
--- root/examples-sandbox/trunk/components/tables/src/main/webapp/home.xhtml 2010-02-19
16:50:37 UTC (rev 16474)
+++ root/examples-sandbox/trunk/components/tables/src/main/webapp/home.xhtml 2010-02-19
16:57:18 UTC (rev 16475)
@@ -13,30 +13,29 @@
<h:body>
<h:form id="form1">
- <rich:dataTable var="record" value="#{dataBean.employeeList}"
rows="20" sortMode="single"
visualModel="#{dataBean.dataTableVisualModel}">
+ <rich:dataTable var="record" value="#{dataBean.employeeList}"
rows="20" sortMode="single">
<f:facet name="caption">
<h:outputText id="captioFacet1" value="Caption Facet" />
</f:facet>
<f:facet name="header">
- <rich:colGroup id="headerFacet1" >
+ <rich:colGroup id="headerFacet1">
<rich:column colspan="3"><h:outputText
id="headerFacet12" value="header column 1">
</h:outputText></rich:column>
<rich:column breakBefore="true"><h:outputText
id="headerFacet13" value="header column
2"></h:outputText></rich:column>
<rich:column colspan="2"><h:outputText
id="headerFacet14" value="header column
3"></h:outputText></rich:column>
</rich:colGroup>
</f:facet>
- <rich:column id="column_name" sortBy="test1"
sortIconAsc="resources/images/asc.gif"
sortIconDesc="resources/images/desc.gif"
sortIconUnsort="resources/images/unsort.gif">
+ <rich:column id="column_name" sortBy="#{record.name}"
sortIconAsc="resources/images/asc.gif"
sortIconDesc="resources/images/desc.gif"
sortIconUnsort="resources/images/unsort.gif">
<f:facet name="header">
<h:outputText id="columnHeader1" value="Column Header
Facet"/>
</f:facet>
-
- <rich:toggleControl forId="expandedSubTable"
expandControl="resources/images/+.gif"
collapseControl="resources/images/-.gif" />
+
<h:outputText value="#{record.name}" />
<f:facet name="footer">
<h:outputText id="columnFooter1" value="Column Footer Facet
1"/>
</f:facet>
</rich:column>
- <rich:column id="column_title" sortBy="test2"
sortIconAsc="resources/images/asc.gif"
sortIconDesc="resources/images/desc.gif"
sortIconUnsort="resources/images/unsort.gif">
+ <rich:column id="column_title" sortBy="#{record.title}"
sortIconAsc="resources/images/asc.gif"
sortIconDesc="resources/images/desc.gif"
sortIconUnsort="resources/images/unsort.gif">
<f:facet name="header">
<h:outputText id="columnHeader2" value="Column Header Facet
2"/>
</f:facet>
@@ -47,14 +46,12 @@
<h:outputText value="#{record.EMail}" />
</rich:column>
-
-
<rich:subTable id="expandedSubTable" var="company"
value="#{record.company}" rows="20" switchType="ajax"
expanded="true">
<f:facet name="header">
<rich:colGroup id="headerFacet1" >
- <rich:column><h:outputText id="headerFacet12"
value="company"> </h:outputText></rich:column>
- <rich:column><h:outputText id="headerFacet13" value="office
location"></h:outputText></rich:column>
- <rich:column><h:outputText id="headerFacet14"
value="phone"></h:outputText></rich:column>
+ <rich:column><h:outputText id="headerFacet12"
value="company"> </h:outputText></rich:column>
+ <rich:column><h:outputText id="headerFacet13"
value="office location"></h:outputText></rich:column>
+ <rich:column><h:outputText id="headerFacet14"
value="phone"></h:outputText></rich:column>
</rich:colGroup>
</f:facet>