Author: ppitonak(a)redhat.com
Date: 2010-08-04 06:55:12 -0400 (Wed, 04 Aug 2010)
New Revision: 18475
Added:
root/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/RichSubTableBean.java
root/tests/metamer/trunk/application/src/main/webapp/components/richSubTable/
root/tests/metamer/trunk/application/src/main/webapp/components/richSubTable/components1.xhtml
root/tests/metamer/trunk/application/src/main/webapp/components/richSubTable/components2.xhtml
root/tests/metamer/trunk/application/src/main/webapp/components/richSubTable/list.xhtml
root/tests/metamer/trunk/application/src/main/webapp/components/richSubTable/simple.xhtml
Modified:
root/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/RichBean.java
Log:
RFPL-731
* added 3 pages for rich:subTable
Modified:
root/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/RichBean.java
===================================================================
---
root/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/RichBean.java 2010-08-04
00:56:13 UTC (rev 18474)
+++
root/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/RichBean.java 2010-08-04
10:55:12 UTC (rev 18475)
@@ -115,6 +115,7 @@
components.put("richJQuery", "Rich jQuery");
components.put("richList", "Rich List");
components.put("richPanel", "Rich Panel");
+ components.put("richSubTable", "Rich SubTable");
}
private void createSkinList() {
Added:
root/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/RichSubTableBean.java
===================================================================
---
root/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/RichSubTableBean.java
(rev 0)
+++
root/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/RichSubTableBean.java 2010-08-04
10:55:12 UTC (rev 18475)
@@ -0,0 +1,131 @@
+/*******************************************************************************
+ * 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.
+ *******************************************************************************/
+package org.richfaces.tests.metamer.bean;
+
+import java.io.Serializable;
+import java.util.ArrayList;
+import java.util.List;
+
+import javax.annotation.PostConstruct;
+import javax.faces.bean.ManagedBean;
+import javax.faces.bean.ManagedProperty;
+import javax.faces.bean.SessionScoped;
+import org.richfaces.component.UISubTable;
+
+import org.richfaces.tests.metamer.Attributes;
+import org.richfaces.tests.metamer.model.Employee;
+import org.richfaces.tests.metamer.model.Employee.Sex;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+/**
+ * Managed bean for rich:subTable.
+ *
+ * @author <a href="mailto:ppitonak@redhat.com">Pavol Pitonak</a>
+ * @version $Revision$
+ */
+@ManagedBean(name = "richSubTableBean")
+@SessionScoped
+public class RichSubTableBean implements Serializable {
+
+ private static final long serialVersionUID = -1L;
+ private static Logger logger;
+ private Attributes attributes;
+ @ManagedProperty(value = "#{model.employees}")
+ private List<Employee> employees;
+ private List<List<Employee>> lists;
+ // true = model, false = empty table
+ private boolean state;
+
+ /**
+ * Initializes the managed bean.
+ */
+ @PostConstruct
+ public void init() {
+ logger = LoggerFactory.getLogger(getClass());
+ logger.debug("initializing bean " + getClass().getName());
+
+ attributes = Attributes.getUIComponentAttributes(UISubTable.class, getClass());
+
+ attributes.setAttribute("expandMode", "client");
+ attributes.setAttribute("expanded", true);
+ attributes.setAttribute("rendered", true);
+ attributes.setAttribute("rows", 5);
+
+ // TODO these attributes have to be tested in another way
+ attributes.remove("componentState");
+ attributes.remove("rowKeyVar");
+ attributes.remove("stateVar");
+ attributes.remove("var");
+ attributes.remove("value");
+
+ List<Employee> men = new ArrayList<Employee>();
+ List<Employee> women = new ArrayList<Employee>();
+
+ for (Employee e : employees) {
+ if (e.getSex() == Sex.MALE) {
+ men.add(e);
+ } else {
+ women.add(e);
+ }
+ }
+
+ lists = new ArrayList<List<Employee>>();
+ lists.add(men);
+ lists.add(women);
+
+ state = true;
+ }
+
+ public Attributes getAttributes() {
+ return attributes;
+ }
+
+ public void setAttributes(Attributes attributes) {
+ this.attributes = attributes;
+ }
+
+ public List<Employee> getEmployees() {
+ return employees;
+ }
+
+ public void setEmployees(List<Employee> employees) {
+ this.employees = employees;
+ }
+
+ public List<List<Employee>> getLists() {
+ return lists;
+ }
+
+ public void setLists(List<List<Employee>> lists) {
+ this.lists = lists;
+ }
+
+ public boolean isState() {
+ return state;
+ }
+
+ public void setState(boolean state) {
+ this.state = state;
+ }
+
+}
Property changes on:
root/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/RichSubTableBean.java
___________________________________________________________________
Name: svn:keywords
+ Revision
Added:
root/tests/metamer/trunk/application/src/main/webapp/components/richSubTable/components1.xhtml
===================================================================
---
root/tests/metamer/trunk/application/src/main/webapp/components/richSubTable/components1.xhtml
(rev 0)
+++
root/tests/metamer/trunk/application/src/main/webapp/components/richSubTable/components1.xhtml 2010-08-04
10:55:12 UTC (rev 18475)
@@ -0,0 +1,150 @@
+<!--
+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.
+-->
+
+<!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:ta="http://java.sun.com/jsf/composite/testapp"
+
xmlns:rich="http://richfaces.org/rich"
xmlns:a4j="http://richfaces.org/a4j">
+
+ <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>
+ </ui:define>
+
+ <ui:define name="outOfTemplateBefore">
+ <br/>
+ </ui:define>
+
+ <ui:define name="component">
+
+ <rich:dataTable value="#{richSubTableBean.lists}"
var="list">
+ <f:facet name="header">
+ <rich:columnGroup>
+ <rich:column colspan="6">
+ <h:outputText id="columnHeaderEmployees"
value="Employees" />
+ </rich:column>
+ <rich:column breakRowBefore="true">
+ <h:outputText id="columnHeaderSex"
value="Sex" />
+ <br/>
+ <h:outputText id="columnHeaderSexComponent"
value="h:graphicImage" />
+ </rich:column>
+ <rich:column>
+ <h:outputText id="columnHeaderName"
value="Name" />
+ <br/>
+ <h:outputText id="columnHeaderNameComponent"
value="h:outputText" />
+ </rich:column>
+ <rich:column>
+ <h:outputText id="columnHeaderTitle"
value="Title" />
+ <br/>
+ <h:outputText id="columnHeaderTitleComponent"
value="rich:inplaceSelect" />
+ </rich:column>
+ <rich:column>
+ <h:outputText id="columnHeaderSmoker"
value="Smoker" />
+ <br/>
+ <h:outputText id="columnHeaderSmokerComponent"
value="h:selectBooleanCheckbox" />
+ </rich:column>
+ <rich:column>
+ <h:outputText id="columnHeaderFavoriteColor"
value="Favorite Color" />
+ <br/>
+ <h:outputText
id="columnHeaderFavoriteColorComponent" value="rich:colorPicker"
/>
+ </rich:column>
+ <rich:column>
+ <h:outputText id="columnHeaderNumberOfKids"
value="Number of Kids" />
+ <br/>
+ <h:outputText
id="columnHeaderNumberOfKidsComponent" value="rich:inputNumberSpinner"
/>
+ </rich:column>
+ </rich:columnGroup>
+ </f:facet>
+ <rich:column colspan="6">
+ <rich:subTableToggleControl for="richSubTable"/>
+ <h:outputText value="#{list[0].sex == 'MALE' ?
'Men' : 'Women'}" />
+ </rich:column>
+ <rich:subTable id="richSubTable"
+
breakBefore="#{richSubTableBean.attributes['breakBefore'].value}"
+
expandMode="#{richSubTableBean.attributes['expandMode'].value}"
+
expanded="#{richSubTableBean.attributes['expanded'].value}"
+
filterVar="#{richSubTableBean.attributes['filterVar'].value}"
+
filteringListeners="#{richSubTableBean.attributes['filteringListeners'].value}"
+
first="#{richSubTableBean.attributes['first'].value}"
+
footer="#{richSubTableBean.attributes['footer'].value}"
+
header="#{richSubTableBean.attributes['header'].value}"
+
iterationState="#{richSubTableBean.attributes['iterationState'].value}"
+
iterationStatusVar="#{richSubTableBean.attributes['iterationStatusVar'].value}"
+
keepSaved="#{richSubTableBean.attributes['keepSaved'].value}"
+
noData="#{richSubTableBean.attributes['noData'].value}"
+
noDataLabel="#{richSubTableBean.attributes['noDataLabel'].value}"
+
relativeRowIndex="#{richSubTableBean.attributes['relativeRowIndex'].value}"
+
rendered="#{richSubTableBean.attributes['rendered'].value}"
+
rowAvailable="#{richSubTableBean.attributes['rowAvailable'].value}"
+
rowCount="#{richSubTableBean.attributes['rowCount'].value}"
+
rowData="#{richSubTableBean.attributes['rowData'].value}"
+
rowIndex="#{richSubTableBean.attributes['rowIndex'].value}"
+
rowKey="#{richSubTableBean.attributes['rowKey'].value}"
+
rowKeyConverter="#{richSubTableBean.attributes['rowKeyConverter'].value}"
+
rows="#{richSubTableBean.attributes['rows'].value}"
+
selection="#{richSubTableBean.attributes['selection'].value}"
+
sortExpression="#{richSubTableBean.attributes['sortExpression'].value}"
+
sortMode="#{richSubTableBean.attributes['sortMode'].value}"
+
sortPriority="#{richSubTableBean.attributes['sortPriority'].value}"
+
sortingListeners="#{richSubTableBean.attributes['sortingListeners'].value}"
+
toggleListeners="#{richSubTableBean.attributes['toggleListeners'].value}"
+ value="#{list}"
+ var="item">
+ <rich:column>
+ <h:graphicImage id="sex" library="images"
name="#{item.sex == 'MALE' ? 'male.png' : 'female.png'}"
/>
+ </rich:column>
+ <rich:column>
+ <h:outputText value="#{item.name}" />
+ </rich:column>
+ <rich:column>
+ <h:outputText value="#{item.title}" />
+ </rich:column>
+ <rich:column>
+ <h:selectBooleanCheckbox id="smokerCheckbox"
value="#{item.smoker}">
+ <a4j:ajax event="change"/>
+ </h:selectBooleanCheckbox>
+ </rich:column>
+ <rich:column>
+ <h:outputText value="#{item.favoriteColor}" />
+ </rich:column>
+ <rich:column>
+ <h:outputText value="#{item.numberOfKids}" />
+ </rich:column>
+ <f:facet name="footer">
+ <h:outputText value="Total of #{list[0].sex ==
'MALE' ? 'men' : 'women'}: #{list.size()}" />
+ </f:facet>
+ </rich:subTable>
+ </rich:dataTable>
+
+ </ui:define>
+
+ <ui:define name="outOfTemplateAfter">
+ <ta:attributes value="#{richSubTableBean.attributes}"
id="attributes" />
+ </ui:define>
+
+ </ui:composition>
+</html>
\ No newline at end of file
Added:
root/tests/metamer/trunk/application/src/main/webapp/components/richSubTable/components2.xhtml
===================================================================
---
root/tests/metamer/trunk/application/src/main/webapp/components/richSubTable/components2.xhtml
(rev 0)
+++
root/tests/metamer/trunk/application/src/main/webapp/components/richSubTable/components2.xhtml 2010-08-04
10:55:12 UTC (rev 18475)
@@ -0,0 +1,152 @@
+<!--
+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.
+-->
+
+<!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:ta="http://java.sun.com/jsf/composite/testapp"
+
xmlns:rich="http://richfaces.org/rich">
+
+ <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>
+ </ui:define>
+
+ <ui:define name="outOfTemplateBefore">
+ <br/>
+ </ui:define>
+
+ <ui:define name="component">
+
+ <rich:dataTable value="#{richSubTableBean.lists}"
var="list">
+ <f:facet name="header">
+ <rich:columnGroup>
+ <rich:column colspan="6">
+ <h:outputText id="columnHeaderEmployees"
value="Employees" />
+ </rich:column>
+ <rich:column breakRowBefore="true">
+ <h:outputText id="columnHeaderSex"
value="Sex" />
+ <br/>
+ <h:outputText id="columnHeaderSexComponent"
value="rich:paint2D" />
+ </rich:column>
+ <rich:column>
+ <h:outputText id="columnHeaderName"
value="Name" />
+ <br/>
+ <h:outputText id="columnHeaderNameComponent"
value="h:inplaceInput" />
+ </rich:column>
+ <rich:column>
+ <h:outputText id="columnHeaderTitle"
value="Title" />
+ <br/>
+ <h:outputText id="columnHeaderTitleComponent"
value="rich:comboBox" />
+ </rich:column>
+ <rich:column>
+ <h:outputText id="columnHeaderBirthdate"
value="Birthdate" />
+ <br/>
+ <h:outputText
id="columnHeaderBirthdateComponent" value="rich:calendar" />
+ </rich:column>
+ <rich:column>
+ <h:outputText id="columnHeaderCompanies"
value="Companies" />
+ <br/>
+ <h:outputText
id="columnHeaderCompaniesComponent" value="a4j:repeat" />
+ </rich:column>
+ <rich:column>
+ <h:outputText id="columnHeaderNumberOfKids"
value="Number of Kids" />
+ <br/>
+ <h:outputText
id="columnHeaderNumberOfKidsComponent" value="rich:inputNumberSlider"
/>
+ </rich:column>
+ </rich:columnGroup>
+ </f:facet>
+ <rich:column colspan="6">
+ <rich:subTableToggleControl for="richSubTable"/>
+ <h:outputText value="#{list[0].sex == 'MALE' ?
'Men' : 'Women'}" />
+ </rich:column>
+ <rich:subTable id="richSubTable"
+
breakBefore="#{richSubTableBean.attributes['breakBefore'].value}"
+
expandMode="#{richSubTableBean.attributes['expandMode'].value}"
+
expanded="#{richSubTableBean.attributes['expanded'].value}"
+
filterVar="#{richSubTableBean.attributes['filterVar'].value}"
+
filteringListeners="#{richSubTableBean.attributes['filteringListeners'].value}"
+
first="#{richSubTableBean.attributes['first'].value}"
+
footer="#{richSubTableBean.attributes['footer'].value}"
+
header="#{richSubTableBean.attributes['header'].value}"
+
iterationState="#{richSubTableBean.attributes['iterationState'].value}"
+
iterationStatusVar="#{richSubTableBean.attributes['iterationStatusVar'].value}"
+
keepSaved="#{richSubTableBean.attributes['keepSaved'].value}"
+
noData="#{richSubTableBean.attributes['noData'].value}"
+
noDataLabel="#{richSubTableBean.attributes['noDataLabel'].value}"
+
relativeRowIndex="#{richSubTableBean.attributes['relativeRowIndex'].value}"
+
rendered="#{richSubTableBean.attributes['rendered'].value}"
+
rowAvailable="#{richSubTableBean.attributes['rowAvailable'].value}"
+
rowCount="#{richSubTableBean.attributes['rowCount'].value}"
+
rowData="#{richSubTableBean.attributes['rowData'].value}"
+
rowIndex="#{richSubTableBean.attributes['rowIndex'].value}"
+
rowKey="#{richSubTableBean.attributes['rowKey'].value}"
+
rowKeyConverter="#{richSubTableBean.attributes['rowKeyConverter'].value}"
+
rows="#{richSubTableBean.attributes['rows'].value}"
+
selection="#{richSubTableBean.attributes['selection'].value}"
+
sortExpression="#{richSubTableBean.attributes['sortExpression'].value}"
+
sortMode="#{richSubTableBean.attributes['sortMode'].value}"
+
sortPriority="#{richSubTableBean.attributes['sortPriority'].value}"
+
sortingListeners="#{richSubTableBean.attributes['sortingListeners'].value}"
+
toggleListeners="#{richSubTableBean.attributes['toggleListeners'].value}"
+ value="#{list}"
+ var="item">
+ <rich:column>
+ <h:outputText value="#{item.sex}" />
+ </rich:column>
+ <rich:column>
+ <h:outputText value="#{item.name}" />
+ </rich:column>
+ <rich:column>
+ <h:outputText value="#{item.title}" />
+ </rich:column>
+ <rich:column>
+ <h:outputText value="#{item.birthdate}" />
+ </rich:column>
+ <rich:column>
+ <ul>
+ <a4j:repeat value="#{item.companies}"
var="company">
+ <li>#{company.name}</li>
+ </a4j:repeat>
+ </ul>
+ </rich:column>
+ <rich:column>
+ <h:outputText value="#{item.numberOfKids}" />
+ </rich:column>
+ <f:facet name="footer">
+ <h:outputText value="Total of #{list[0].sex ==
'MALE' ? 'men' : 'women'}: #{list.size()}" />
+ </f:facet>
+ </rich:subTable>
+ </rich:dataTable>
+
+ </ui:define>
+
+ <ui:define name="outOfTemplateAfter">
+ <ta:attributes value="#{richSubTableBean.attributes}"
id="attributes" />
+ </ui:define>
+
+ </ui:composition>
+</html>
\ No newline at end of file
Added:
root/tests/metamer/trunk/application/src/main/webapp/components/richSubTable/list.xhtml
===================================================================
---
root/tests/metamer/trunk/application/src/main/webapp/components/richSubTable/list.xhtml
(rev 0)
+++
root/tests/metamer/trunk/application/src/main/webapp/components/richSubTable/list.xhtml 2010-08-04
10:55:12 UTC (rev 18475)
@@ -0,0 +1,51 @@
+<!--
+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.
+-->
+
+<!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:ui="http://java.sun.com/jsf/facelets"
+
xmlns:ta="http://java.sun.com/jsf/composite/testapp">
+
+ <ui:composition template="/templates/list.xhtml">
+
+ <ui:define name="pageTitle">Rich SubTable</ui:define>
+
+ <ui:define name="links">
+
+ <ta:testPageLink id="simple" outcome="simple"
value="Simple">
+ Page that contains a table with two <b>rich:subTable</b>s
with defined facets (header, footer, noData) and input boxes for all its attributes.
+ </ta:testPageLink>
+
+ <ta:testPageLink id="components1"
outcome="components1" value="Various Components 1">
+ Page that contains a table with two <b>rich:subTable</b>s
(with model containing employees) and input boxes for all its attributes.
+ <span style="color: red">TODO will be used with various
types of input and command components as soon as available</span>
+ </ta:testPageLink>
+
+ <ta:testPageLink id="components2"
outcome="components2" value="Various Components 2">
+ Page that contains a table with two <b>rich:subTable</b>s
(with model containing employees) and input boxes for all its attributes.
+ <span style="color: red">TODO will be used with various
types of input and command components as soon as available</span>
+ </ta:testPageLink>
+
+ </ui:define>
+
+ </ui:composition>
+
+</html>
Added:
root/tests/metamer/trunk/application/src/main/webapp/components/richSubTable/simple.xhtml
===================================================================
---
root/tests/metamer/trunk/application/src/main/webapp/components/richSubTable/simple.xhtml
(rev 0)
+++
root/tests/metamer/trunk/application/src/main/webapp/components/richSubTable/simple.xhtml 2010-08-04
10:55:12 UTC (rev 18475)
@@ -0,0 +1,138 @@
+<!--
+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.
+-->
+
+<!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:ta="http://java.sun.com/jsf/composite/testapp"
+
xmlns:rich="http://richfaces.org/rich"
xmlns:a4j="http://richfaces.org/a4j">
+
+ <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>
+ </ui:define>
+
+ <ui:define name="outOfTemplateBefore">
+ <br/>
+ <h:outputText value="Show data in table: " />
+ <h:selectBooleanCheckbox value="#{richSubTableBean.state}">
+ <a4j:ajax render="richDataTable"/>
+ </h:selectBooleanCheckbox>
+ <br/><br/>
+ </ui:define>
+
+ <ui:define name="component">
+
+ <rich:dataTable id="richDataTable"
value="#{richSubTableBean.lists}" var="list">
+ <f:facet name="header">
+ <rich:columnGroup>
+ <rich:column colspan="3">
+ <h:outputText id="columnHeaderEmployees"
value="Employees" />
+ </rich:column>
+ <rich:column breakRowBefore="true">
+ <h:outputText id="columnHeaderName"
value="Name" />
+ </rich:column>
+ <rich:column>
+ <h:outputText id="columnHeaderTitle"
value="Title" />
+ </rich:column>
+ <rich:column>
+ <h:outputText id="columnHeaderBirthdate"
value="Birthdate" />
+ </rich:column>
+ </rich:columnGroup>
+ </f:facet>
+
+ <rich:column colspan="3">
+ <rich:subTableToggleControl for="richSubTable"/>
+ <h:outputText value="#{list[0].sex == 'MALE' ?
'Men' : 'Women'}" />
+ </rich:column>
+
+ <rich:subTable id="richSubTable"
+
breakBefore="#{richSubTableBean.attributes['breakBefore'].value}"
+
expandMode="#{richSubTableBean.attributes['expandMode'].value}"
+
expanded="#{richSubTableBean.attributes['expanded'].value}"
+
filterVar="#{richSubTableBean.attributes['filterVar'].value}"
+
filteringListeners="#{richSubTableBean.attributes['filteringListeners'].value}"
+
first="#{richSubTableBean.attributes['first'].value}"
+
footer="#{richSubTableBean.attributes['footer'].value}"
+
header="#{richSubTableBean.attributes['header'].value}"
+
iterationState="#{richSubTableBean.attributes['iterationState'].value}"
+
iterationStatusVar="#{richSubTableBean.attributes['iterationStatusVar'].value}"
+
keepSaved="#{richSubTableBean.attributes['keepSaved'].value}"
+
noData="#{richSubTableBean.attributes['noData'].value}"
+
noDataLabel="#{richSubTableBean.attributes['noDataLabel'].value}"
+
relativeRowIndex="#{richSubTableBean.attributes['relativeRowIndex'].value}"
+
rendered="#{richSubTableBean.attributes['rendered'].value}"
+
rowAvailable="#{richSubTableBean.attributes['rowAvailable'].value}"
+
rowCount="#{richSubTableBean.attributes['rowCount'].value}"
+
rowData="#{richSubTableBean.attributes['rowData'].value}"
+
rowIndex="#{richSubTableBean.attributes['rowIndex'].value}"
+
rowKey="#{richSubTableBean.attributes['rowKey'].value}"
+
rowKeyConverter="#{richSubTableBean.attributes['rowKeyConverter'].value}"
+
rows="#{richSubTableBean.attributes['rows'].value}"
+
selection="#{richSubTableBean.attributes['selection'].value}"
+
sortExpression="#{richSubTableBean.attributes['sortExpression'].value}"
+
sortMode="#{richSubTableBean.attributes['sortMode'].value}"
+
sortPriority="#{richSubTableBean.attributes['sortPriority'].value}"
+
sortingListeners="#{richSubTableBean.attributes['sortingListeners'].value}"
+
toggleListeners="#{richSubTableBean.attributes['toggleListeners'].value}"
+ value="#{richSubTableBean.state ? list : null}"
+ var="item">
+
+ <f:facet name="header">
+ header facet
+ </f:facet>
+
+ <f:facet name="noData">
+ no data facet
+ </f:facet>
+
+ <rich:column>
+ <h:outputText value="#{item.name}" />
+ </rich:column>
+ <rich:column>
+ <h:outputText value="#{item.title}" />
+ </rich:column>
+ <rich:column>
+ <h:outputText value="#{item.birthdate}">
+ <f:convertDateTime pattern="d MMM yyyy"/>
+ </h:outputText>
+ </rich:column>
+
+ <f:facet name="footer">
+ footer facet
+ </f:facet>
+
+ </rich:subTable>
+ </rich:dataTable>
+
+ </ui:define>
+
+ <ui:define name="outOfTemplateAfter">
+ <ta:attributes value="#{richSubTableBean.attributes}"
id="attributes" />
+ </ui:define>
+
+ </ui:composition>
+</html>
\ No newline at end of file