Author: prabhat.jha(a)jboss.com
Date: 2010-08-29 00:38:11 -0400 (Sun, 29 Aug 2010)
New Revision: 19006
Modified:
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/RichColumnBean.java
modules/tests/metamer/trunk/application/src/main/webapp/components/richColumn/list.xhtml
modules/tests/metamer/trunk/application/src/main/webapp/components/richColumn/simple.xhtml
Log:
some more features for rich:column
Modified:
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/RichColumnBean.java
===================================================================
---
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/RichColumnBean.java 2010-08-28
19:55:30 UTC (rev 19005)
+++
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/RichColumnBean.java 2010-08-29
04:38:11 UTC (rev 19006)
@@ -22,19 +22,13 @@
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.UIColumn;
-
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;
@@ -50,13 +44,8 @@
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;
-
+ private Attributes attributes;
+
/**
* Initializes the managed bean.
*/
@@ -66,29 +55,17 @@
logger.debug("initializing bean " + getClass().getName());
attributes = Attributes.getUIComponentAttributes(UIColumn.class, getClass());
-
-
-// attributes.setAttribute("rendered", true);
-
- // TODO these attributes have to be tested in another way
- // attributes.remove("componentState");
-
- 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;
+ attributes.setAttribute("rendered", true);
+ attributes.setAttribute("columnSpan", 1);
+
+ /*breakRowBefore=""
+ colspan=""
+ comparator=""
+ filter=""
+ filterValue=""
+ rendered=""
+ rowspan=""
+ sortOrder=""*/
}
public Attributes getAttributes() {
@@ -99,28 +76,5 @@
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;
- }
-
+
}
Modified:
modules/tests/metamer/trunk/application/src/main/webapp/components/richColumn/list.xhtml
===================================================================
---
modules/tests/metamer/trunk/application/src/main/webapp/components/richColumn/list.xhtml 2010-08-28
19:55:30 UTC (rev 19005)
+++
modules/tests/metamer/trunk/application/src/main/webapp/components/richColumn/list.xhtml 2010-08-29
04:38:11 UTC (rev 19006)
@@ -31,7 +31,7 @@
<ui:define name="links">
<metamer:testPageLink id="simple" outcome="simple"
value="Simple">
- Simple page that contains blah blah
+ Simple page that contains a table with two columns
</metamer:testPageLink>
</ui:define>
Modified:
modules/tests/metamer/trunk/application/src/main/webapp/components/richColumn/simple.xhtml
===================================================================
---
modules/tests/metamer/trunk/application/src/main/webapp/components/richColumn/simple.xhtml 2010-08-28
19:55:30 UTC (rev 19005)
+++
modules/tests/metamer/trunk/application/src/main/webapp/components/richColumn/simple.xhtml 2010-08-29
04:38:11 UTC (rev 19006)
@@ -40,7 +40,35 @@
</ui:define>
<ui:define name="component">
-
+
+ <rich:dataTable id="richDataTable"
+ rendered="true"
+ value="#{model.capitals}"
+ rows="5"
+ var="record"
+ >
+ <rich:column id="columnState"
+
rendered="#{richColumnBean.attributes['rendered'].value}"
+
colspan="#{richColumnBean.attributes['colspan'].value}"
+
sortOrder="#{richColumnBean.attributes['sortOrder'].value}"
+ >
+ <f:facet name="header">
+ <h:outputText id="columnHeaderState"
value="State" />
+ </f:facet>
+ <h:outputText value="#{record.state}" />
+ <f:facet name="footer">
+ <h:outputText id="columnFooterState"
value="State" />
+ </f:facet>
+ </rich:column>
+ <rich:column id="columnCapital"
+
filter="#{richColumnBean.attributes['filter'].value}"
+ >
+ <f:facet name="header">
+ <h:outputText id="columnCapitalState"
value="Capital" />
+ </f:facet>
+ <h:outputText value="#{record.name}" />
+ </rich:column>
+ </rich:dataTable>
</ui:define>
<ui:define name="outOfTemplateAfter">
Show replies by date