Author: ppitonak(a)redhat.com
Date: 2011-03-02 12:19:25 -0500 (Wed, 02 Mar 2011)
New Revision: 22021
Modified:
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/RichDataTableBean.java
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/RichExtendedDataTableBean.java
modules/tests/metamer/trunk/application/src/main/webapp/components/richDataTable/facets.xhtml
modules/tests/metamer/trunk/application/src/main/webapp/components/richExtendedDataTable/facets.xhtml
Log:
added facet footer to data table and EDT
Modified:
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/RichDataTableBean.java
===================================================================
---
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/RichDataTableBean.java 2011-03-02
17:09:16 UTC (rev 22020)
+++
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/RichDataTableBean.java 2011-03-02
17:19:25 UTC (rev 22021)
@@ -53,21 +53,16 @@
private static final long serialVersionUID = -1L;
private static Logger logger;
private Attributes attributes;
-
private transient UIDataTable binding;
private DataComponentState dataTableState;
private Map<Object, Integer> stateMap = new HashMap<Object, Integer>();
-
private int page = 1;
// true = model, false = empty table
private boolean state = true;
-
// sorting
private ColumnSortingMap sorting = new CustomColumnSortingMap();
-
// filtering
private Map<String, Object> filtering = new HashMap<String, Object>();
-
// facets
private Map<String, String> facets = new HashMap<String, String>();
@@ -88,26 +83,27 @@
facets.put("noData", "There is no data.");
facets.put("caption", "Caption");
facets.put("header", "Header");
+ facets.put("footer", "Footer");
facets.put("columnStateHeader", "State Header");
facets.put("columnStateFooter", "State Footer");
facets.put("columnCapitalHeader", "Capital Header");
facets.put("columnCapitalFooter", "Capital Footer");
-
+
// attributes already in page
attributes.remove("value");
attributes.remove("var");
-
+
// TODO needs to be tested another way
attributes.remove("filterVar");
attributes.remove("iterationStatusVar");
attributes.remove("rowKeyVar");
attributes.remove("stateVar");
}
-
+
public void setBinding(UIDataTable binding) {
this.binding = binding;
}
-
+
public UIDataTable getBinding() {
return binding;
}
@@ -174,15 +170,16 @@
public boolean accept(Employee e) {
String sex = (String) getFiltering().get("sex");
if (sex == null || sex.length() == 0 ||
sex.equalsIgnoreCase("all")
- || sex.equalsIgnoreCase(e.getSex().toString())) {
+ || sex.equalsIgnoreCase(e.getSex().toString())) {
return true;
}
return false;
}
};
}
-
+
private class CustomColumnSortingMap extends ColumnSortingMap {
+
private static final long serialVersionUID = 1L;
protected UIDataTableBase getBinding() {
Modified:
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/RichExtendedDataTableBean.java
===================================================================
---
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/RichExtendedDataTableBean.java 2011-03-02
17:09:16 UTC (rev 22020)
+++
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/RichExtendedDataTableBean.java 2011-03-02
17:19:25 UTC (rev 22021)
@@ -49,7 +49,7 @@
@ManagedBean(name = "richExtendedDataTableBean")
@ViewScoped
public class RichExtendedDataTableBean implements Serializable {
-
+
private static final long serialVersionUID = 1L;
private static Logger logger;
private Attributes attributes;
@@ -99,7 +99,7 @@
// attributes which are already in page
attributes.remove("value");
attributes.remove("var");
-
+
// TODO attributes which needs to be tested another way
attributes.remove("filterVar");
attributes.remove("iterationStatusVar");
@@ -109,6 +109,7 @@
// facets initial values
facets.put("noData", "There is no data.");
facets.put("header", "Header");
+ facets.put("footer", "Footer");
facets.put("columnStateHeader", "State Header");
facets.put("columnStateFooter", "State Footer");
facets.put("columnCapitalHeader", "Capital Header");
Modified:
modules/tests/metamer/trunk/application/src/main/webapp/components/richDataTable/facets.xhtml
===================================================================
---
modules/tests/metamer/trunk/application/src/main/webapp/components/richDataTable/facets.xhtml 2011-03-02
17:09:16 UTC (rev 22020)
+++
modules/tests/metamer/trunk/application/src/main/webapp/components/richDataTable/facets.xhtml 2011-03-02
17:19:25 UTC (rev 22021)
@@ -123,6 +123,11 @@
</f:facet>
</rich:column>
+ <f:facet name="footer">
+ <h:outputText id="footer"
value="#{richDataTableBean.facets['footer']}"
+ rendered="#{not empty
richDataTableBean.facets['footer']}" />
+ </f:facet>
+
</rich:dataTable>
</ui:define>
@@ -139,6 +144,9 @@
<h:outputLabel value="Header Facet:" />
<h:inputText id="headerInput"
value="#{richDataTableBean.facets['header']}" />
+ <h:outputLabel value="Footer Facet:" />
+ <h:inputText id="footerInput"
value="#{richDataTableBean.facets['footer']}" />
+
<h:outputLabel value="State Column Header:" />
<h:inputText id="stateHeaderInput"
value="#{richDataTableBean.facets['columnStateHeader']}" />
Modified:
modules/tests/metamer/trunk/application/src/main/webapp/components/richExtendedDataTable/facets.xhtml
===================================================================
---
modules/tests/metamer/trunk/application/src/main/webapp/components/richExtendedDataTable/facets.xhtml 2011-03-02
17:09:16 UTC (rev 22020)
+++
modules/tests/metamer/trunk/application/src/main/webapp/components/richExtendedDataTable/facets.xhtml 2011-03-02
17:19:25 UTC (rev 22021)
@@ -86,7 +86,8 @@
sortMode="#{richExtendedDataTableBean.attributes['sortMode'].value}"
sortPriority="#{richExtendedDataTableBean.attributes['sortPriority'].value}"
style="#{richExtendedDataTableBean.attributes['style'].value}"
-
styleClass="#{richExtendedDataTableBean.attributes['styleClass'].value}"value="#{richExtendedDataTableBean.state
? model.capitals : null}"
+
styleClass="#{richExtendedDataTableBean.attributes['styleClass'].value}"
+ value="#{richExtendedDataTableBean.state ?
model.capitals : null}"
var="record"
@@ -124,6 +125,11 @@
</f:facet>
</rich:column>
+ <f:facet name="footer">
+ <h:outputText id="footer"
value="#{richExtendedDataTableBean.facets['footer']}"
+ rendered="#{not empty
richExtendedDataTableBean.facets['footer']}"/>
+ </f:facet>
+
</rich:extendedDataTable>
</ui:define>
@@ -136,6 +142,9 @@
<h:outputLabel value="Header Facet:" />
<h:inputText id="headerInput"
value="#{richExtendedDataTableBean.facets['header']}" />
+ <h:outputLabel value="Footer Facet:" />
+ <h:inputText id="footerInput"
value="#{richExtendedDataTableBean.facets['footer']}" />
+
<h:outputLabel value="State Column Header:" />
<h:inputText id="stateHeaderInput"
value="#{richExtendedDataTableBean.facets['columnStateHeader']}" />