Author: ppitonak(a)redhat.com
Date: 2010-08-04 08:07:03 -0400 (Wed, 04 Aug 2010)
New Revision: 18476
Added:
root/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/RichSubTableToggleControlBean.java
root/tests/metamer/trunk/application/src/main/webapp/components/richSubTableToggleControl/
root/tests/metamer/trunk/application/src/main/webapp/components/richSubTableToggleControl/components1.xhtml
root/tests/metamer/trunk/application/src/main/webapp/components/richSubTableToggleControl/components2.xhtml
root/tests/metamer/trunk/application/src/main/webapp/components/richSubTableToggleControl/list.xhtml
root/tests/metamer/trunk/application/src/main/webapp/components/richSubTableToggleControl/simple.xhtml
Modified:
root/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/RichBean.java
Log:
RFPL-732
* added rich:subTableToggleControl to Metamer
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
10:55:12 UTC (rev 18475)
+++
root/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/RichBean.java 2010-08-04
12:07:03 UTC (rev 18476)
@@ -115,7 +115,8 @@
components.put("richJQuery", "Rich jQuery");
components.put("richList", "Rich List");
components.put("richPanel", "Rich Panel");
- components.put("richSubTable", "Rich SubTable");
+ components.put("richSubTable", "Rich Subtable");
+ components.put("richSubTableToggleControl", "Rich Subtable Toggle
Control");
}
private void createSkinList() {
Added:
root/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/RichSubTableToggleControlBean.java
===================================================================
---
root/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/RichSubTableToggleControlBean.java
(rev 0)
+++
root/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/RichSubTableToggleControlBean.java 2010-08-04
12:07:03 UTC (rev 18476)
@@ -0,0 +1,123 @@
+/*******************************************************************************
+ * 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.UISubTableToggleControl;
+
+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:subTableToggleControl.
+ *
+ * @author <a href="mailto:ppitonak@redhat.com">Pavol Pitonak</a>
+ * @version $Revision$
+ */
+@ManagedBean(name = "richSubTableToggleControlBean")
+@SessionScoped
+public class RichSubTableToggleControlBean 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(UISubTableToggleControl.class,
getClass());
+ attributes.setAttribute("event", "click");
+ attributes.setAttribute("rendered", true);
+ // TODO these attributes have to be tested in another way
+ attributes.remove("for");
+
+ 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;
+ }
+
+}
Added:
root/tests/metamer/trunk/application/src/main/webapp/components/richSubTableToggleControl/components1.xhtml
===================================================================
---
root/tests/metamer/trunk/application/src/main/webapp/components/richSubTableToggleControl/components1.xhtml
(rev 0)
+++
root/tests/metamer/trunk/application/src/main/webapp/components/richSubTableToggleControl/components1.xhtml 2010-08-04
12:07:03 UTC (rev 18476)
@@ -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/richSubTableToggleControl/components2.xhtml
===================================================================
---
root/tests/metamer/trunk/application/src/main/webapp/components/richSubTableToggleControl/components2.xhtml
(rev 0)
+++
root/tests/metamer/trunk/application/src/main/webapp/components/richSubTableToggleControl/components2.xhtml 2010-08-04
12:07:03 UTC (rev 18476)
@@ -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/richSubTableToggleControl/list.xhtml
===================================================================
---
root/tests/metamer/trunk/application/src/main/webapp/components/richSubTableToggleControl/list.xhtml
(rev 0)
+++
root/tests/metamer/trunk/application/src/main/webapp/components/richSubTableToggleControl/list.xhtml 2010-08-04
12:07:03 UTC (rev 18476)
@@ -0,0 +1,41 @@
+<!--
+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 Toggle
Control</ui:define>
+
+ <ui:define name="links">
+
+ <ta:testPageLink id="simple" outcome="simple"
value="Simple">
+ Page that contains a table with two subtables and input boxes for all
<b>rich:subTableToggleControl</b>s' attributes.
+ </ta:testPageLink>
+
+ </ui:define>
+
+ </ui:composition>
+
+</html>
Added:
root/tests/metamer/trunk/application/src/main/webapp/components/richSubTableToggleControl/simple.xhtml
===================================================================
---
root/tests/metamer/trunk/application/src/main/webapp/components/richSubTableToggleControl/simple.xhtml
(rev 0)
+++
root/tests/metamer/trunk/application/src/main/webapp/components/richSubTableToggleControl/simple.xhtml 2010-08-04
12:07:03 UTC (rev 18476)
@@ -0,0 +1,121 @@
+<!--
+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="#{richSubTableToggleControlBean.state}">
+ <a4j:ajax render="richDataTable"/>
+ </h:selectBooleanCheckbox>
+ <br/><br/>
+ </ui:define>
+
+ <ui:define name="component">
+
+ <rich:dataTable id="richDataTable"
value="#{richSubTableToggleControlBean.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 id="richSTTControl"
+
collapseIcon="#{richSubTableToggleControlBean.attributes['collapseIcon'].value}"
+
collapseLable="#{richSubTableToggleControlBean.attributes['collapseLabel'].value}"
+
event="#{richSubTableToggleControlBean.attributes['event'].value}"
+
expandIcon="#{richSubTableToggleControlBean.attributes['expandIcon'].value}"
+
expandLabel="#{richSubTableToggleControlBean.attributes['expandLabel'].value}"
+
rendered="#{richSubTableToggleControlBean.attributes['rendered'].value}"
+ for="richSubTable"/>
+ <h:outputText value="#{list[0].sex == 'MALE' ?
'Men' : 'Women'}" />
+ </rich:column>
+
+ <rich:subTable id="richSubTable"
+ expandMode="client"
+ expanded="true"
+ rows="5"
+
+ value="#{richSubTableToggleControlBean.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="#{richSubTableToggleControlBean.attributes}" id="attributes"
/>
+ </ui:define>
+
+ </ui:composition>
+</html>
\ No newline at end of file