Author: ppitonak(a)redhat.com
Date: 2011-03-31 12:06:42 -0400 (Thu, 31 Mar 2011)
New Revision: 22346
Added:
modules/tests/metamer/trunk/application/src/main/webapp/components/richDataGrid/facets.xhtml
Modified:
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/RichDataGridBean.java
modules/tests/metamer/trunk/application/src/main/webapp/components/richDataGrid/list.xhtml
Log:
https://issues.jboss.org/browse/RFPL-741
added facets page for rich:dataGrid
Modified:
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/RichDataGridBean.java
===================================================================
---
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/RichDataGridBean.java 2011-03-31
15:27:03 UTC (rev 22345)
+++
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/RichDataGridBean.java 2011-03-31
16:06:42 UTC (rev 22346)
@@ -22,6 +22,8 @@
package org.richfaces.tests.metamer.bean;
import java.io.Serializable;
+import java.util.HashMap;
+import java.util.Map;
import javax.annotation.PostConstruct;
import javax.faces.bean.ManagedBean;
@@ -48,6 +50,7 @@
// true = model, false = empty table
private boolean state = true;
private int page = 1;
+ private Map<String, String> facets = new HashMap<String, String>();
/**
* Initializes the managed bean.
@@ -70,6 +73,12 @@
attributes.remove("iterationStatusVar");
attributes.remove("rowKeyVar");
attributes.remove("stateVar");
+
+ // facets initial values
+ facets.put("noData", "There is no data.");
+ facets.put("caption", "Caption");
+ facets.put("header", "Header");
+ facets.put("footer", "Footer");
}
public Attributes getAttributes() {
@@ -95,4 +104,12 @@
public void setPage(int page) {
this.page = page;
}
+
+ public Map<String, String> getFacets() {
+ return facets;
+ }
+
+ public void setFacets(Map<String, String> facets) {
+ this.facets = facets;
+ }
}
Added:
modules/tests/metamer/trunk/application/src/main/webapp/components/richDataGrid/facets.xhtml
===================================================================
---
modules/tests/metamer/trunk/application/src/main/webapp/components/richDataGrid/facets.xhtml
(rev 0)
+++
modules/tests/metamer/trunk/application/src/main/webapp/components/richDataGrid/facets.xhtml 2011-03-31
16:06:42 UTC (rev 22346)
@@ -0,0 +1,114 @@
+<?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:f="http://java.sun.com/jsf/core"
+
xmlns:ui="http://java.sun.com/jsf/facelets"
xmlns:a4j="http://richfaces.org/a4j"
+
xmlns:metamer="http://java.sun.com/jsf/composite/metamer"
xmlns:rich="http://richfaces.org/rich">
+
+ <!--
+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:param name="componentId" value="richDataGrid" />
+
+ <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="head">
+ <h:outputStylesheet library="css"
name="richDataGrid.css" />
+ </ui:define>
+
+ <ui:define name="component">
+ <h:panelGroup layout="div">
+ <h:outputText value="Show data in table: " />
+ <h:selectBooleanCheckbox id="noDataCheckbox"
value="#{richDataGridBean.state}">
+ <a4j:ajax render="#{nestedComponentId}"/>
+ </h:selectBooleanCheckbox>
+ </h:panelGroup>
+
+ <rich:dataGrid id="richDataGrid"
+
columns="#{richDataGridBean.attributes['columns'].value}"
+
first="#{richDataGridBean.attributes['first'].value}"
+
elements="#{richDataGridBean.attributes['elements'].value}"
+
keepSaved="#{richDataGridBean.attributes['keepSaved'].value}"
+
rendered="#{richDataGridBean.attributes['rendered'].value}"
+
style="#{richDataGridBean.attributes['style'].value}"
+
styleClass="#{richDataGridBean.attributes['styleClass'].value}"
+
title="#{richDataGridBean.attributes['title'].value}"
+ value="#{richDataGridBean.state ? model.capitals :
null}"
+ var="record">
+
+ <f:facet name="noData">
+ <h:outputText id="noData"
value="#{richDataGridBean.facets['noData']}" style="color:
red;"
+ rendered="#{not empty
richDataGridBean.facets['noData']}"/>
+ </f:facet>
+
+ <f:facet name="caption">
+ <h:outputText id="caption"
value="#{richDataGridBean.facets['caption']}"
+ rendered="#{not empty
richDataGridBean.facets['caption']}"/>
+ </f:facet>
+
+ <f:facet name="header">
+ <h:outputText id="header"
value="#{richDataGridBean.facets['header']}"
+ rendered="#{not empty
richDataGridBean.facets['header']}" />
+ </f:facet>
+
+ <f:facet name="footer">
+ <h:outputText id="footer"
value="#{richDataGridBean.facets['footer']}"
+ rendered="#{not empty
richDataGridBean.facets['footer']}" />
+ </f:facet>
+
+ <h:outputText value="#{record.state}"
style="font-weight: bold;" />
+ <br />
+ <h:outputText value="#{record.name}" />
+
+ </rich:dataGrid>
+ </ui:define>
+
+ <ui:define name="outOfTemplateAfter">
+ <a4j:ajax render="#{nestedComponentId}">
+ <h:panelGrid columns="2">
+ <h:outputLabel value="No Data Facet: " />
+ <h:inputText id="noDataInput"
value="#{richDataGridBean.facets['noData']}" />
+
+ <h:outputLabel value="Caption Facet: " />
+ <h:inputText id="captionInput"
value="#{richDataGridBean.facets['caption']}" />
+
+ <h:outputLabel value="Header Facet:" />
+ <h:inputText id="headerInput"
value="#{richDataGridBean.facets['header']}" />
+
+ <h:outputLabel value="Footer Facet:" />
+ <h:inputText id="footerInput"
value="#{richDataGridBean.facets['footer']}" />
+ </h:panelGrid>
+ </a4j:ajax>
+
+ <br/><br/>
+
+ <metamer:attributes value="#{richDataGridBean.attributes}"
id="attributes" />
+ </ui:define>
+
+ </ui:composition>
+</html>
\ No newline at end of file
Modified:
modules/tests/metamer/trunk/application/src/main/webapp/components/richDataGrid/list.xhtml
===================================================================
---
modules/tests/metamer/trunk/application/src/main/webapp/components/richDataGrid/list.xhtml 2011-03-31
15:27:03 UTC (rev 22345)
+++
modules/tests/metamer/trunk/application/src/main/webapp/components/richDataGrid/list.xhtml 2011-03-31
16:06:42 UTC (rev 22346)
@@ -36,6 +36,10 @@
input boxes for all its attributes.
</metamer:testPageLink>
+ <metamer:testPageLink id="facets" outcome="facets"
value="Facets">
+ Page for testing of facets.
+ </metamer:testPageLink>
+
<metamer:testPageLink id="scroller" outcome="scroller"
value="Data Scroller">
Page that contains <b>rich:dataGrid</b> (with model
containing capitals), data
scroller and input boxes for all its attributes.