Author: jjamrich
Date: 2011-11-24 18:53:52 -0500 (Thu, 24 Nov 2011)
New Revision: 23004
Added:
modules/tests/metamer/trunk/application/src/main/webapp/components/richCollapsibleSubTable/rf-11656.xhtml
Modified:
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/rich/RichCollapsibleSubTableBean.java
modules/tests/metamer/trunk/application/src/main/webapp/components/richCollapsibleSubTable/list.xhtml
Log:
RF-11656: add example to simulate issue
Modified:
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/rich/RichCollapsibleSubTableBean.java
===================================================================
---
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/rich/RichCollapsibleSubTableBean.java 2011-11-24
17:56:59 UTC (rev 23003)
+++
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/rich/RichCollapsibleSubTableBean.java 2011-11-24
23:53:52 UTC (rev 23004)
@@ -79,6 +79,9 @@
private Map<String, Object> filtering = new HashMap<String, Object>();
// expanded
private Map<List<Employee>, Boolean> expanded = new
HashMap<List<Employee>, Boolean>();
+
+ // expanded state for employee detail (for RF-11656)
+ private Map<Employee, Boolean> expandedEmployee = new HashMap<Employee,
Boolean>();
/**
* Initializes the managed bean.
@@ -181,4 +184,12 @@
public Map<List<Employee>, Boolean> getExpanded() {
return expanded;
}
+
+ public Map<Employee, Boolean> getExpandedEmployee() {
+ return expandedEmployee;
+ }
+
+ public void setExpandedEmployee(Map<Employee, Boolean> expandedEmployee) {
+ this.expandedEmployee = expandedEmployee;
+ }
}
Modified:
modules/tests/metamer/trunk/application/src/main/webapp/components/richCollapsibleSubTable/list.xhtml
===================================================================
---
modules/tests/metamer/trunk/application/src/main/webapp/components/richCollapsibleSubTable/list.xhtml 2011-11-24
17:56:59 UTC (rev 23003)
+++
modules/tests/metamer/trunk/application/src/main/webapp/components/richCollapsibleSubTable/list.xhtml 2011-11-24
23:53:52 UTC (rev 23004)
@@ -64,6 +64,10 @@
<metamer:testPageLink id="keepSaved"
outcome="keepSaved" value="Keep Saved">
Page for testing attribute keepSaved of
<b>rich:collapsibleSubTable</b>.
</metamer:testPageLink>
+
+ <metamer:testPageLink id="rf-11656" outcome="rf-11656"
value="RF-11656">
+ Page for testing <a
href="https://issues.jboss.org/browse/RF-11656" target="_blank"
>RF-11656</a>
+ </metamer:testPageLink>
</ui:define>
Added:
modules/tests/metamer/trunk/application/src/main/webapp/components/richCollapsibleSubTable/rf-11656.xhtml
===================================================================
---
modules/tests/metamer/trunk/application/src/main/webapp/components/richCollapsibleSubTable/rf-11656.xhtml
(rev 0)
+++
modules/tests/metamer/trunk/application/src/main/webapp/components/richCollapsibleSubTable/rf-11656.xhtml 2011-11-24
23:53:52 UTC (rev 23004)
@@ -0,0 +1,132 @@
+<?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:a4j="http://richfaces.org/a4j"
+
xmlns:rich="http://richfaces.org/rich"
+
xmlns:f="http://java.sun.com/jsf/core"
+
xmlns:ui="http://java.sun.com/jsf/facelets"
+
xmlns:c="http://java.sun.com/jsp/jstl/core"
+
xmlns:metamer="http://java.sun.com/jsf/composite/metamer">
+
+ <!--
+JBoss, Home of Professional Open Source
+Copyright 2010-2011, 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="view">
+ <f:metadata>
+ <f:viewParam name="templates"
value="#{templateBean.templates}">
+ <f:converter converterId="templatesListConverter" />
+ </f:viewParam>
+ </f:metadata>
+ </ui:define>
+
+ <ui:define name="component">
+
+ <p>
+ Page with nested collapsibleSubTable to verify <a
href="https://issues.jboss.org/browse/RF-11656"
target="_blank">RF-11656</a>
+ <br/><br/>
+ Nested collapsibleSubTable contains information about employee's
company (Company Name and Phone).
+ <br/>
+ collapsibleSubTableToggler managing @expanded on nested
CollapsibleSubTable is labeled "Employess's Company Details".
+ If you are not able to collapse Company details for employee, it is still
not working<br/>
+ This attribute value (@expanded) for nested collapsibleSubTable should be
set to false as well, and don't work.
+ </p>
+
+ <rich:dataTable id="richDataTable"
value="#{richSubTableBean.lists}" var="list"
keepSaved="true">
+ <f:facet name="header">
+ <rich:columnGroup id="columnGroup">
+ <rich:column id="columnHeaderEmployees"
colspan="3">
+ <h:outputText id="columnHeaderEmployeesText"
value="Employees" />
+ </rich:column>
+ <rich:column id="columnHeaderName"
breakRowBefore="true">
+ <h:outputText id="columnHeaderNameText"
value="Name" />
+ </rich:column>
+ <rich:column id="columnHeaderTitle">
+ <h:outputText id="columnHeaderTitleText"
value="Title" />
+ </rich:column>
+ <rich:column id="columnHeaderBirthdate">
+ <h:outputText id="columnHeaderBirthdateText"
value="Birthdate" />
+ </rich:column>
+ </rich:columnGroup>
+ </f:facet>
+
+ <rich:column id="columnSubTable1" colspan="3">
+ <rich:collapsibleSubTableToggler id="subTableTC"
for="richSubTable1"/>
+ <h:outputText value="#{list[0].sex == 'MALE' ?
'Men' : 'Women'}" />
+ </rich:column>
+
+
+ <rich:collapsibleSubTable id="richSubTable1"
+ value="#{richSubTableBean.state ? list :
null}"
+ var="employee"
+ rows="3"
+ expandMode="ajax"
+
expanded="#{richSubTableBean.expanded[list]}">
+
+ <rich:column>
+ <h:outputText style="margin-left: 15px"
value="#{employee.name}"/>
+ </rich:column>
+ <rich:column>
+ <h:outputText value="#{employee.title}"/>
+ </rich:column>
+ <rich:column id="columnBirthdate">
+ <h:outputText id="birthdate"
value="#{employee.birthdate}">
+ <f:convertDateTime pattern="d MMM yyyy"/>
+ </h:outputText>
+ </rich:column>
+
+ <rich:collapsibleSubTable value="#{employee.companies}"
+ var="company"
+ id="richSubTable2"
+ rows="2"
+ expandMode="ajax"
+
expanded="#{richSubTableBean.expandedEmployee[employee]}">
+ <!-- Following ^^^^^^^^ attribute doesn't influence
component as expected -->
+ <rich:column>
+ <f:facet name="header">
+ <rich:collapsibleSubTableToggler
id="subTableTC2" for="richSubTable2"/>
+ <h:outputText value="Employee's Company
Details" />
+ </f:facet>
+ </rich:column>
+
+ <rich:column>
+ <f:facet name="header">
+ <h:outputText value="Company Name"/>
+ </f:facet>
+ <h:outputText style="margin-left: 30px"
value="#{company.name}"/>
+ </rich:column>
+ <rich:column>
+ <f:facet name="header">
+ <h:outputText value="Company Phone"/>
+ </f:facet>
+ <h:outputText value="#{company.phone}"/>
+ </rich:column>
+ </rich:collapsibleSubTable>
+ </rich:collapsibleSubTable>
+
+ </rich:dataTable>
+ </ui:define>
+
+ </ui:composition>
+</html>
\ No newline at end of file