Author: konstantin.mishin
Date: 2010-03-31 07:55:08 -0400 (Wed, 31 Mar 2010)
New Revision: 16690
Modified:
root/examples-sandbox/trunk/components/tables/src/main/java/org/richfaces/demo/DataBean.java
root/examples-sandbox/trunk/components/tables/src/main/webapp/extendedtable.xhtml
Log:
RF-7852 ExtendedDataTable sample
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-03-31
10:46:24 UTC (rev 16689)
+++
root/examples-sandbox/trunk/components/tables/src/main/java/org/richfaces/demo/DataBean.java 2010-03-31
11:55:08 UTC (rev 16690)
@@ -1,5 +1,6 @@
package org.richfaces.demo;
+import java.util.Date;
import java.util.List;
import javax.faces.bean.ManagedBean;
@@ -49,5 +50,8 @@
public void sortingListener(SortingEvent event) {
System.out.println(event.getSortOrder());
}
-
+
+ public Date getDate() {
+ return new Date();
+ }
}
Modified:
root/examples-sandbox/trunk/components/tables/src/main/webapp/extendedtable.xhtml
===================================================================
---
root/examples-sandbox/trunk/components/tables/src/main/webapp/extendedtable.xhtml 2010-03-31
10:46:24 UTC (rev 16689)
+++
root/examples-sandbox/trunk/components/tables/src/main/webapp/extendedtable.xhtml 2010-03-31
11:55:08 UTC (rev 16690)
@@ -1,3 +1,10 @@
+<?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:rich="http://richfaces.org/rich">
<!--
JBoss, Home of Professional Open Source
Copyright ${year}, Red Hat, Inc. and individual contributors
@@ -22,12 +29,6 @@
Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
02110-1301 USA, or see the FSF site:
http://www.fsf.org.
-->
-<!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:rich="http://richfaces.org/rich">
<f:view contentType="text/html"/>
<h:head>
@@ -47,9 +48,11 @@
<h:selectBooleanCheckbox value="#{dataBean.state}">
<f:ajax render="extendedDataTable" />
</h:selectBooleanCheckbox>
- <rich:extendedDataTable id="extendedDataTable" clientRows="40"
rows="100" frozenColumns="2" value="#{dataBean.state ?
dataBean.employeeList : null}" var="record" noDataLabel="There
isn't data." styleClass="extendedDataTable">
+ <rich:extendedDataTable id="extendedDataTable" clientRows="40"
rows="100" frozenColumns="2"
+ value="#{dataBean.state ? dataBean.employeeList : null}"
var="record" noDataLabel="There isn't data."
+ styleClass="extendedDataTable" rowKeyVar="rkv">
<f:facet name="header">
- <h:outputText value="Header of table."/>
+ <h:outputText value="Current date: #{dataBean.date}"/>
</f:facet>
<f:facet name="footer">
<h:outputText value="Footer of table."/>
@@ -57,6 +60,15 @@
<f:facet name="noData">
<h:outputText value="There isn't data." style="border: solid
black 1px;"/>
</f:facet>
+ <rich:column >
+ <f:facet name="header">
+ <h:outputText value="Index"/>
+ </f:facet>
+ <h:outputText value="#{rkv}" />
+ <f:facet name="footer">
+ <h:outputText value="index"/>
+ </f:facet>
+ </rich:column>
<rich:column id="column_name">
<f:facet name="header">
<h:outputText id="columnHeader1" value="Column Header
Facet"/>
@@ -78,13 +90,13 @@
<h:outputText value="#{record.EMail}" />
</rich:column>
<rich:column id="column_company_name" width="300px">
- <h:outputText value="#{record.company.name}" />
+ <h:outputText value="#{record.companies[0].name}" />
</rich:column>
<rich:column id="column_company_state">
- <h:outputText value="#{record.company.state}" />
+ <h:outputText value="#{record.companies[0].state}" />
</rich:column>
<rich:column id="column_company_phone">
- <h:outputText value="#{record.company.phone}" />
+ <h:outputText value="#{record.companies[0].phone}" />
</rich:column>
</rich:extendedDataTable>
<input type="submit" />