Author: ppitonak(a)redhat.com
Date: 2010-08-11 09:39:54 -0400 (Wed, 11 Aug 2010)
New Revision: 18552
Added:
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/HDataTableBean.java
modules/tests/metamer/trunk/application/src/main/webapp/components/hDataTable/
modules/tests/metamer/trunk/application/src/main/webapp/components/hDataTable/components1.xhtml
modules/tests/metamer/trunk/application/src/main/webapp/components/hDataTable/components2.xhtml
modules/tests/metamer/trunk/application/src/main/webapp/components/hDataTable/list.xhtml
modules/tests/metamer/trunk/application/src/main/webapp/components/hDataTable/scroller.xhtml
modules/tests/metamer/trunk/application/src/main/webapp/components/hDataTable/simple.xhtml
modules/tests/metamer/trunk/application/src/main/webapp/resources/css/hDataTable.css
Modified:
modules/tests/metamer/trunk/application/src/main/webapp/templates/template.xhtml
Log:
* added 4 pages for component h:dataTable
* one unnecessary namespace deklaration removed from template
Added:
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/HDataTableBean.java
===================================================================
---
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/HDataTableBean.java
(rev 0)
+++
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/HDataTableBean.java 2010-08-11
13:39:54 UTC (rev 18552)
@@ -0,0 +1,111 @@
+/*******************************************************************************
+ * 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.Date;
+import java.util.HashMap;
+import java.util.Map;
+import javax.annotation.PostConstruct;
+
+import javax.faces.bean.ManagedBean;
+import javax.faces.bean.SessionScoped;
+import javax.faces.component.html.HtmlDataTable;
+
+import org.richfaces.tests.metamer.Attributes;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+/**
+ * Managed bean for h:dataTable.
+ *
+ * @author <a href="mailto:ppitonak@redhat.com">Pavol Pitonak</a>
+ * @version $Revision$
+ */
+@ManagedBean(name = "hDataTableBean")
+@SessionScoped
+public class HDataTableBean implements Serializable {
+
+ private static final long serialVersionUID = 4814439475400649809L;
+ private static Logger logger;
+ private Attributes attributes;
+ private Map<Object, Integer> stateMap = new HashMap<Object, Integer>();
+ private int page = 1;
+ // true = model, false = empty table
+ private boolean state = true;
+
+ /**
+ * Initializes the managed bean.
+ */
+ @PostConstruct
+ public void init() {
+ logger = LoggerFactory.getLogger(getClass());
+ logger.debug("initializing bean " + getClass().getName());
+
+ attributes = Attributes.getUIComponentAttributes(HtmlDataTable.class,
getClass());
+
+ attributes.setAttribute("rendered", true);
+ attributes.setAttribute("rows", 10);
+ // TODO has to be tested in other way
+ attributes.remove("bodyrows");
+ attributes.remove("header");
+ attributes.remove("footer");
+ attributes.remove("rowIndex");
+ }
+
+ public Attributes getAttributes() {
+ return attributes;
+ }
+
+ public void setAttributes(Attributes attributes) {
+ this.attributes = attributes;
+ }
+
+ public int getPage() {
+ return page;
+ }
+
+ public void setPage(int page) {
+ this.page = page;
+ }
+
+ public Map<Object, Integer> getStateMap() {
+ return stateMap;
+ }
+
+ public void setStateMap(Map<Object, Integer> stateMap) {
+ this.stateMap = stateMap;
+ }
+
+ public boolean isState() {
+ return state;
+ }
+
+ public void setState(boolean state) {
+ this.state = state;
+ }
+
+ public Date getDate() {
+ return new Date();
+ }
+
+}
Added:
modules/tests/metamer/trunk/application/src/main/webapp/components/hDataTable/components1.xhtml
===================================================================
---
modules/tests/metamer/trunk/application/src/main/webapp/components/hDataTable/components1.xhtml
(rev 0)
+++
modules/tests/metamer/trunk/application/src/main/webapp/components/hDataTable/components1.xhtml 2010-08-11
13:39:54 UTC (rev 18552)
@@ -0,0 +1,193 @@
+<!--
+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:a4j="http://richfaces.org/a4j"
+
xmlns:metamer="http://java.sun.com/jsf/composite/metamer"
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>
+ <h:outputStylesheet library="css"
name="hDataTable.css"/>
+ </ui:define>
+
+ <ui:define name="outOfTemplateBefore">
+ <br/>
+ <h:outputText value="Show data in table: " />
+ <h:selectBooleanCheckbox value="#{hDataTableBean.state}">
+ <a4j:ajax render="hDataTable scroller1"/>
+ </h:selectBooleanCheckbox>
+ <br/><br/>
+ <rich:dataScroller id="scroller1" for="hDataTable"
page="#{hDataTableBean.page}" maxPages="7"
render="hDataTable"/>
+ </ui:define>
+
+ <ui:define name="component">
+
+ <h:dataTable id="hDataTable"
+
bgcolor="#{hDataTableBean.attributes['bgcolor'].value}"
+
border="#{hDataTableBean.attributes['border'].value}"
+
captionClass="#{hDataTableBean.attributes['captionClass'].value}"
+
captionStyle="#{hDataTableBean.attributes['captionStyle'].value}"
+
cellpadding="#{hDataTableBean.attributes['cellpadding'].value}"
+
cellspacing="#{hDataTableBean.attributes['cellspacing'].value}"
+
columnClasses="#{hDataTableBean.attributes['columnClasses'].value}"
+
dir="#{hDataTableBean.attributes['dir'].value}"
+
first="#{hDataTableBean.attributes['first'].value}"
+
footerClass="#{hDataTableBean.attributes['footerClass'].value}"
+
frame="#{hDataTableBean.attributes['frame'].value}"
+
headerClass="#{hDataTableBean.attributes['headerClass'].value}"
+
lang="#{hDataTableBean.attributes['lang'].value}"
+
onclick="#{hDataTableBean.attributes['onclick'].value}"
+
ondblclick="#{hDataTableBean.attributes['ondblclick'].value}"
+
onkeydown="#{hDataTableBean.attributes['onkeydown'].value}"
+
onkeypress="#{hDataTableBean.attributes['onkeypress'].value}"
+
onkeyup="#{hDataTableBean.attributes['onkeyup'].value}"
+
onmousedown="#{hDataTableBean.attributes['onmousedown'].value}"
+
onmousemove="#{hDataTableBean.attributes['onmousemove'].value}"
+
onmouseout="#{hDataTableBean.attributes['onmouseout'].value}"
+
onmouseover="#{hDataTableBean.attributes['onmouseover'].value}"
+
onmouseup="#{hDataTableBean.attributes['onmouseup'].value}"
+
rendered="#{hDataTableBean.attributes['rendered'].value}"
+
rowAvailable="#{hDataTableBean.attributes['rowAvailable'].value}"
+
rowClasses="#{hDataTableBean.attributes['rowClasses'].value}"
+
rowCount="#{hDataTableBean.attributes['rowCount'].value}"
+
rowData="#{hDataTableBean.attributes['rowData'].value}"
+
rows="#{hDataTableBean.attributes['rows'].value}"
+
rules="#{hDataTableBean.attributes['rules'].value}"
+
style="#{hDataTableBean.attributes['style'].value}"
+
styleClass="#{hDataTableBean.attributes['styleClass'].value}"
+
summary="#{hDataTableBean.attributes['summary'].value}"
+
title="#{hDataTableBean.attributes['title'].value}"
+ value="#{hDataTableBean.state ? model.employees :
null}"
+ var="record"
+
width="#{hDataTableBean.attributes['width'].value}"
+ >
+
+ <f:facet name="caption">
+ <h:outputText id="captionFacet" value="Caption
Facet" />
+ </f:facet>
+
+ <f:facet name="header">
+ <h:outputText value="Header Facet" />
+ </f:facet>
+
+ <h:column id="columnSex">
+ <f:facet name="header">
+ <h:outputText id="columnHeaderSex"
value="Sex" />
+ <br/>
+ <h:outputText id="columnHeaderSexComponent"
value="h:graphicImage" />
+ </f:facet>
+
+ <h:graphicImage library="images" name="#{record.sex
== 'MALE' ? 'male.png' : 'female.png'}" />
+
+ <f:facet name="footer">
+ <h:outputText id="columnFooterSex"
value="Sex" />
+ </f:facet>
+ </h:column>
+
+ <h:column id="columnName">
+ <f:facet name="header">
+ <h:outputText id="columnHeaderName"
value="Name" />
+ <br/>
+ <h:outputText id="columnHeaderNameComponent"
value="h:outputText" />
+ </f:facet>
+
+ <h:outputText value="#{record.name}" />
+ <f:facet name="footer">
+ <h:outputText id="columnFooterState"
value="Name" />
+ </f:facet>
+ </h:column>
+
+ <h:column id="columnTitle">
+ <f:facet name="header">
+ <h:outputText id="columnHeaderTitle"
value="Title" />
+ <br/>
+ <h:outputText id="columnHeaderTitleComponent"
value="rich:inplaceSelect" />
+ </f:facet>
+
+ <h:outputText value="#{record.title}" />
+ <f:facet name="footer">
+ <h:outputText id="columnFooterTitle"
value="Title" />
+ </f:facet>
+ </h:column>
+
+ <h:column id="columnSmoker">
+ <f:facet name="header">
+ <h:outputText id="columnHeaderSmoker"
value="Smoker" />
+ <br/>
+ <h:outputText id="columnHeaderSmokerComponent"
value="h:selectBooleanCheckbox" />
+ </f:facet>
+
+ <h:selectBooleanCheckbox value="#{record.smoker}">
+ <a4j:ajax id="ajaxSmoker"
event="change"/>
+ </h:selectBooleanCheckbox>
+
+ <f:facet name="footer">
+ <h:outputText id="columnFooterSmoker"
value="Smoker" />
+ </f:facet>
+ </h:column>
+
+ <h:column id="columnFavoriteColor">
+ <f:facet name="header">
+ <h:outputText id="columnHeaderFavoriteColor"
value="Favorite Color" />
+ <br/>
+ <h:outputText
id="columnHeaderFavoriteColorComponent" value="rich:colorPicker"
/>
+ </f:facet>
+
+ <h:outputText value="#{record.favoriteColor}" />
+ <f:facet name="footer">
+ <h:outputText id="columnFooterFavoriteColor"
value="Favorite Color" />
+ </f:facet>
+ </h:column>
+
+ <h:column id="columnNumberOfKids">
+ <f:facet name="header">
+ <h:outputText id="columnHeaderNumberOfKids"
value="Number of Kids" />
+ <br/>
+ <h:outputText id="columnHeaderNumberOfKidsComponent"
value="rich:inputNumberSpinner" />
+ </f:facet>
+
+ <h:outputText value="#{record.numberOfKids}" />
+ <f:facet name="footer">
+ <h:outputText id="columnFooterNumberOfKids"
value="Number of Kids" />
+ </f:facet>
+ </h:column>
+
+ <f:facet name="footer">
+ <rich:dataScroller id="scroller2"
for="hDataTable" page="#{hDataTableBean.page}" maxPages="7"
render="hDataTable" />
+ </f:facet>
+
+ </h:dataTable>
+ </ui:define>
+
+ <ui:define name="outOfTemplateAfter">
+ <metamer:attributes value="#{hDataTableBean.attributes}"
id="attributes" />
+ </ui:define>
+
+ </ui:composition>
+</html>
\ No newline at end of file
Added:
modules/tests/metamer/trunk/application/src/main/webapp/components/hDataTable/components2.xhtml
===================================================================
---
modules/tests/metamer/trunk/application/src/main/webapp/components/hDataTable/components2.xhtml
(rev 0)
+++
modules/tests/metamer/trunk/application/src/main/webapp/components/hDataTable/components2.xhtml 2010-08-11
13:39:54 UTC (rev 18552)
@@ -0,0 +1,195 @@
+<!--
+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:a4j="http://richfaces.org/a4j"
+
xmlns:metamer="http://java.sun.com/jsf/composite/metamer"
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>
+ <h:outputStylesheet library="css"
name="hDataTable.css"/>
+ </ui:define>
+
+ <ui:define name="outOfTemplateBefore">
+ <br/>
+ <h:outputText value="Show data in table: " />
+ <h:selectBooleanCheckbox value="#{hDataTableBean.state}">
+ <a4j:ajax render="hDataTable scroller1"/>
+ </h:selectBooleanCheckbox>
+ <br/><br/>
+ <rich:dataScroller id="scroller1" for="hDataTable"
page="#{hDataTableBean.page}" maxPages="7"
render="hDataTable"/>
+ </ui:define>
+
+ <ui:define name="component">
+
+ <h:dataTable id="hDataTable"
+
bgcolor="#{hDataTableBean.attributes['bgcolor'].value}"
+
border="#{hDataTableBean.attributes['border'].value}"
+
captionClass="#{hDataTableBean.attributes['captionClass'].value}"
+
captionStyle="#{hDataTableBean.attributes['captionStyle'].value}"
+
cellpadding="#{hDataTableBean.attributes['cellpadding'].value}"
+
cellspacing="#{hDataTableBean.attributes['cellspacing'].value}"
+
columnClasses="#{hDataTableBean.attributes['columnClasses'].value}"
+
dir="#{hDataTableBean.attributes['dir'].value}"
+
first="#{hDataTableBean.attributes['first'].value}"
+
footerClass="#{hDataTableBean.attributes['footerClass'].value}"
+
frame="#{hDataTableBean.attributes['frame'].value}"
+
headerClass="#{hDataTableBean.attributes['headerClass'].value}"
+
lang="#{hDataTableBean.attributes['lang'].value}"
+
onclick="#{hDataTableBean.attributes['onclick'].value}"
+
ondblclick="#{hDataTableBean.attributes['ondblclick'].value}"
+
onkeydown="#{hDataTableBean.attributes['onkeydown'].value}"
+
onkeypress="#{hDataTableBean.attributes['onkeypress'].value}"
+
onkeyup="#{hDataTableBean.attributes['onkeyup'].value}"
+
onmousedown="#{hDataTableBean.attributes['onmousedown'].value}"
+
onmousemove="#{hDataTableBean.attributes['onmousemove'].value}"
+
onmouseout="#{hDataTableBean.attributes['onmouseout'].value}"
+
onmouseover="#{hDataTableBean.attributes['onmouseover'].value}"
+
onmouseup="#{hDataTableBean.attributes['onmouseup'].value}"
+
rendered="#{hDataTableBean.attributes['rendered'].value}"
+
rowAvailable="#{hDataTableBean.attributes['rowAvailable'].value}"
+
rowClasses="#{hDataTableBean.attributes['rowClasses'].value}"
+
rowCount="#{hDataTableBean.attributes['rowCount'].value}"
+
rowData="#{hDataTableBean.attributes['rowData'].value}"
+
rows="#{hDataTableBean.attributes['rows'].value}"
+
rules="#{hDataTableBean.attributes['rules'].value}"
+
style="#{hDataTableBean.attributes['style'].value}"
+
styleClass="#{hDataTableBean.attributes['styleClass'].value}"
+
summary="#{hDataTableBean.attributes['summary'].value}"
+
title="#{hDataTableBean.attributes['title'].value}"
+ value="#{hDataTableBean.state ? model.employees :
null}"
+ var="record"
+
width="#{hDataTableBean.attributes['width'].value}"
+ >
+
+ <f:facet name="caption">
+ <h:outputText id="captionFacet" value="Caption
Facet" />
+ </f:facet>
+
+ <f:facet name="header">
+ <h:outputText value="Header Facet" />
+ </f:facet>
+
+ <h:column id="columnSex">
+ <f:facet name="header">
+ <h:outputText id="columnHeaderSex"
value="Sex" />
+ <br/>
+ <h:outputText id="columnHeaderSexComponent"
value="rich:paint2D" />
+ </f:facet>
+
+ <h:outputText value="#{record.sex}" />
+ <f:facet name="footer">
+ <h:outputText id="columnFooterSex"
value="Sex" />
+ </f:facet>
+ </h:column>
+
+ <h:column id="columnName">
+ <f:facet name="header">
+ <h:outputText id="columnHeaderName"
value="Name" />
+ <br/>
+ <h:outputText id="columnHeaderNameComponent"
value="h:inplaceInput" />
+ </f:facet>
+
+ <h:outputText value="#{record.name}" />
+ <f:facet name="footer">
+ <h:outputText id="columnFooterState"
value="Name" />
+ </f:facet>
+ </h:column>
+
+ <h:column id="columnTitle">
+ <f:facet name="header">
+ <h:outputText id="columnHeaderTitle"
value="Title" />
+ <br/>
+ <h:outputText id="columnHeaderTitleComponent"
value="rich:comboBox" />
+ </f:facet>
+
+ <h:outputText value="#{record.title}" />
+ <f:facet name="footer">
+ <h:outputText id="columnFooterTitle"
value="Title" />
+ </f:facet>
+ </h:column>
+
+ <h:column id="columnBirthdate">
+ <f:facet name="header">
+ <h:outputText id="columnHeaderBirthdate"
value="Birthdate" />
+ <br/>
+ <h:outputText id="columnHeaderBirthdateComponent"
value="rich:calendar" />
+ </f:facet>
+
+ <h:outputText value="#{record.birthdate}" />
+ <f:facet name="footer">
+ <h:outputText id="columnFooterBirthdate"
value="Birthdate" />
+ </f:facet>
+ </h:column>
+
+ <h:column id="columnCompanies">
+ <f:facet name="header">
+ <h:outputText id="columnHeaderCompanies"
value="Companies" />
+ <br/>
+ <h:outputText id="columnHeaderCompaniesComponent"
value="a4j:repeat" />
+ </f:facet>
+
+ <ul>
+ <a4j:repeat value="#{record.companies}"
var="company">
+ <li>#{company.name}</li>
+ </a4j:repeat>
+
+ </ul>
+
+ <f:facet name="footer">
+ <h:outputText id="columnFooterSmoker"
value="Smoker" />
+ </f:facet>
+ </h:column>
+
+ <h:column id="columnNumberOfKids">
+ <f:facet name="header">
+ <h:outputText id="columnHeaderNumberOfKids"
value="Number of Kids" />
+ <br/>
+ <h:outputText id="columnHeaderNumberOfKidsComponent"
value="rich:inputNumberSlider" />
+ </f:facet>
+
+ <h:outputText value="#{record.numberOfKids}" />
+ <f:facet name="footer">
+ <h:outputText id="columnFooterNumberOfKids"
value="Number of Kids" />
+ </f:facet>
+ </h:column>
+
+ <f:facet name="footer">
+ <rich:dataScroller id="scroller2"
for="hDataTable" page="#{hDataTableBean.page}" maxPages="7"
render="hDataTable" />
+ </f:facet>
+
+ </h:dataTable>
+ </ui:define>
+
+ <ui:define name="outOfTemplateAfter">
+ <metamer:attributes value="#{hDataTableBean.attributes}"
id="attributes" />
+ </ui:define>
+
+ </ui:composition>
+</html>
\ No newline at end of file
Added:
modules/tests/metamer/trunk/application/src/main/webapp/components/hDataTable/list.xhtml
===================================================================
---
modules/tests/metamer/trunk/application/src/main/webapp/components/hDataTable/list.xhtml
(rev 0)
+++
modules/tests/metamer/trunk/application/src/main/webapp/components/hDataTable/list.xhtml 2010-08-11
13:39:54 UTC (rev 18552)
@@ -0,0 +1,55 @@
+<!--
+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:metamer="http://java.sun.com/jsf/composite/metamer">
+
+ <ui:composition template="/templates/list.xhtml">
+
+ <ui:define name="pageTitle">JSF Data Table</ui:define>
+
+ <ui:define name="links">
+
+ <metamer:testPageLink id="simple" outcome="simple"
value="Simple">
+ Simple page that contains <b>h:dataTable</b> (with model
containing capitals) and input boxes for all its attributes.
+ </metamer:testPageLink>
+
+ <metamer:testPageLink id="scroller" outcome="scroller"
value="Data Scroller">
+ Page that contains <b>h:dataTable</b> (with model containing
capitals), data scroller and input boxes for all its attributes.
+ </metamer:testPageLink>
+
+ <metamer:testPageLink id="components1"
outcome="components1" value="Various Components 1">
+ Page that contains <b>h:dataTable</b> (with model containing
employees) and input boxes for all its attributes.
+ <span style="color: red">TODO will be used with various
types of input and command components as soon as available</span>
+ </metamer:testPageLink>
+
+ <metamer:testPageLink id="components2"
outcome="components2" value="Various Components 2">
+ Page that contains <b>h:dataTable</b> (with model containing
employees) and input boxes for all its attributes.
+ <span style="color: red">TODO will be used with various
types of input and command components as soon as available</span>
+ </metamer:testPageLink>
+
+ </ui:define>
+
+ </ui:composition>
+
+</html>
Added:
modules/tests/metamer/trunk/application/src/main/webapp/components/hDataTable/scroller.xhtml
===================================================================
---
modules/tests/metamer/trunk/application/src/main/webapp/components/hDataTable/scroller.xhtml
(rev 0)
+++
modules/tests/metamer/trunk/application/src/main/webapp/components/hDataTable/scroller.xhtml 2010-08-11
13:39:54 UTC (rev 18552)
@@ -0,0 +1,196 @@
+<!--
+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:a4j="http://richfaces.org/a4j"
+
xmlns:metamer="http://java.sun.com/jsf/composite/metamer"
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>
+ <h:outputStylesheet library="css"
name="hDataTable.css"/>
+ </ui:define>
+
+ <ui:define name="outOfTemplateBefore">
+ <br/>
+ <h:outputText value="Show data in table: " />
+ <h:selectBooleanCheckbox value="#{hDataTableBean.state}">
+ <a4j:ajax render="hDataTable scroller1"/>
+ </h:selectBooleanCheckbox>
+ <br/><br/>
+ <rich:dataScroller id="scroller1" for="hDataTable"
page="#{hDataTableBean.page}" maxPages="7"
render="hDataTable"/>
+ </ui:define>
+
+ <ui:define name="component">
+ <h:dataTable id="hDataTable"
+
bgcolor="#{hDataTableBean.attributes['bgcolor'].value}"
+
border="#{hDataTableBean.attributes['border'].value}"
+
captionClass="#{hDataTableBean.attributes['captionClass'].value}"
+
captionStyle="#{hDataTableBean.attributes['captionStyle'].value}"
+
cellpadding="#{hDataTableBean.attributes['cellpadding'].value}"
+
cellspacing="#{hDataTableBean.attributes['cellspacing'].value}"
+
columnClasses="#{hDataTableBean.attributes['columnClasses'].value}"
+
dir="#{hDataTableBean.attributes['dir'].value}"
+
first="#{hDataTableBean.attributes['first'].value}"
+
footerClass="#{hDataTableBean.attributes['footerClass'].value}"
+
frame="#{hDataTableBean.attributes['frame'].value}"
+
headerClass="#{hDataTableBean.attributes['headerClass'].value}"
+
lang="#{hDataTableBean.attributes['lang'].value}"
+
onclick="#{hDataTableBean.attributes['onclick'].value}"
+
ondblclick="#{hDataTableBean.attributes['ondblclick'].value}"
+
onkeydown="#{hDataTableBean.attributes['onkeydown'].value}"
+
onkeypress="#{hDataTableBean.attributes['onkeypress'].value}"
+
onkeyup="#{hDataTableBean.attributes['onkeyup'].value}"
+
onmousedown="#{hDataTableBean.attributes['onmousedown'].value}"
+
onmousemove="#{hDataTableBean.attributes['onmousemove'].value}"
+
onmouseout="#{hDataTableBean.attributes['onmouseout'].value}"
+
onmouseover="#{hDataTableBean.attributes['onmouseover'].value}"
+
onmouseup="#{hDataTableBean.attributes['onmouseup'].value}"
+
rendered="#{hDataTableBean.attributes['rendered'].value}"
+
rowAvailable="#{hDataTableBean.attributes['rowAvailable'].value}"
+
rowClasses="#{hDataTableBean.attributes['rowClasses'].value}"
+
rowCount="#{hDataTableBean.attributes['rowCount'].value}"
+
rowData="#{hDataTableBean.attributes['rowData'].value}"
+
rows="#{hDataTableBean.attributes['rows'].value}"
+
rules="#{hDataTableBean.attributes['rules'].value}"
+
style="#{hDataTableBean.attributes['style'].value}"
+
styleClass="#{hDataTableBean.attributes['styleClass'].value}"
+
summary="#{hDataTableBean.attributes['summary'].value}"
+
title="#{hDataTableBean.attributes['title'].value}"
+ value="#{hDataTableBean.state ? model.capitals :
null}"
+ var="record"
+
width="#{hDataTableBean.attributes['width'].value}"
+ >
+
+ <f:facet name="caption">
+ <h:outputText id="captionFacet" value="Caption
Facet" />
+ </f:facet>
+
+ <f:facet name="header">
+ <h:outputText value="Header Facet" />
+ </f:facet>
+
+ <h:column id="columnState">
+ <f:facet name="header">
+ <h:outputText id="columnHeaderState"
value="State Header" />
+ </f:facet>
+
+ <h:outputText value="#{record.state}" />
+ <f:facet name="footer">
+ <h:outputText id="columnFooterState"
value="State Footer" />
+ </f:facet>
+ </h:column>
+
+ <h:column id="columnCapital">
+ <f:facet name="header">
+ <h:outputText id="columnHeaderCapital"
value="Capital Header" />
+ </f:facet>
+
+ <h:outputText value="#{record.name}" />
+ <f:facet name="footer">
+ <h:outputText id="columnFooterCapital"
value="Capital Footer" />
+ </f:facet>
+ </h:column>
+
+ <f:facet name="footer">
+ <rich:dataScroller id="scroller2"
for="hDataTable" page="#{hDataTableBean.page}" maxPages="7"
render="hDataTable" />
+ </f:facet>
+
+ </h:dataTable>
+
+ </ui:define>
+
+ <ui:define name="outOfTemplateAfter">
+ <h:commandButton value="sort state">
+ <rich:componentControl event="click"
target="hDataTable" operation="sort"/>
+ </h:commandButton>
+
+ <h:commandButton value="sort capital">
+ <rich:componentControl event="click"
target="hDataTable" operation="sort">
+ <f:param value="columnCapital" />
+ </rich:componentControl>
+ </h:commandButton>
+
+ <br/><br/>
+
+ <fieldset>
+ <legend>scroller1</legend>
+
+ <h:commandButton value="<< first">
+ <rich:componentControl event="click"
target="#{rich:clientId('scroller1')}"
operation="switchToPage">
+ <f:param value="first" />
+ </rich:componentControl>
+ </h:commandButton>
+
+ <h:commandButton value="< previous">
+ <rich:componentControl event="click"
target="#{rich:clientId('scroller1')}" operation="previous"
/>
+ </h:commandButton>
+
+ <h:commandButton value="next >">
+ <rich:componentControl event="click"
target="#{rich:clientId('scroller1')}" operation="next" />
+ </h:commandButton>
+
+ <h:commandButton value="last >>">
+ <rich:componentControl event="click"
target="#{rich:clientId('scroller1')}"
operation="switchToPage">
+ <f:param value="last" />
+ </rich:componentControl>
+ </h:commandButton>
+ </fieldset>
+
+ <br/>
+
+ <fieldset>
+ <legend>scroller2</legend>
+ <h:commandButton value="<< first">
+ <rich:componentControl event="click"
target="#{rich:clientId('scroller2')}"
operation="switchToPage">
+ <f:param value="first" />
+ </rich:componentControl>
+ </h:commandButton>
+
+ <h:commandButton value="< previous">
+ <rich:componentControl event="click"
target="#{rich:clientId('scroller2')}" operation="previous"
/>
+ </h:commandButton>
+
+ <h:commandButton value="next >">
+ <rich:componentControl event="click"
target="#{rich:clientId('scroller2')}" operation="next" />
+ </h:commandButton>
+
+ <h:commandButton value="last >>">
+ <rich:componentControl event="click"
target="#{rich:clientId('scroller2')}"
operation="switchToPage">
+ <f:param value="last" />
+ </rich:componentControl>
+ </h:commandButton>
+ </fieldset>
+
+ <br/><br/>
+
+ <metamer:attributes value="#{hDataTableBean.attributes}"
id="attributes" />
+ </ui:define>
+
+ </ui:composition>
+</html>
\ No newline at end of file
Added:
modules/tests/metamer/trunk/application/src/main/webapp/components/hDataTable/simple.xhtml
===================================================================
---
modules/tests/metamer/trunk/application/src/main/webapp/components/hDataTable/simple.xhtml
(rev 0)
+++
modules/tests/metamer/trunk/application/src/main/webapp/components/hDataTable/simple.xhtml 2010-08-11
13:39:54 UTC (rev 18552)
@@ -0,0 +1,132 @@
+<!--
+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:a4j="http://richfaces.org/a4j"
+
xmlns:metamer="http://java.sun.com/jsf/composite/metamer"
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>
+ <h:outputStylesheet library="css"
name="hDataTable.css"/>
+ </ui:define>
+
+ <ui:define name="outOfTemplateBefore">
+ <br/>
+ <h:outputText value="Show data in table: " />
+ <h:selectBooleanCheckbox value="#{hDataTableBean.state}">
+ <a4j:ajax render="hDataTable scroller1"/>
+ </h:selectBooleanCheckbox>
+ <br/><br/>
+ </ui:define>
+
+ <ui:define name="component">
+
+ <h:dataTable id="hDataTable"
+
bgcolor="#{hDataTableBean.attributes['bgcolor'].value}"
+
border="#{hDataTableBean.attributes['border'].value}"
+
captionClass="#{hDataTableBean.attributes['captionClass'].value}"
+
captionStyle="#{hDataTableBean.attributes['captionStyle'].value}"
+
cellpadding="#{hDataTableBean.attributes['cellpadding'].value}"
+
cellspacing="#{hDataTableBean.attributes['cellspacing'].value}"
+
columnClasses="#{hDataTableBean.attributes['columnClasses'].value}"
+
dir="#{hDataTableBean.attributes['dir'].value}"
+
first="#{hDataTableBean.attributes['first'].value}"
+
footerClass="#{hDataTableBean.attributes['footerClass'].value}"
+
frame="#{hDataTableBean.attributes['frame'].value}"
+
headerClass="#{hDataTableBean.attributes['headerClass'].value}"
+
lang="#{hDataTableBean.attributes['lang'].value}"
+
onclick="#{hDataTableBean.attributes['onclick'].value}"
+
ondblclick="#{hDataTableBean.attributes['ondblclick'].value}"
+
onkeydown="#{hDataTableBean.attributes['onkeydown'].value}"
+
onkeypress="#{hDataTableBean.attributes['onkeypress'].value}"
+
onkeyup="#{hDataTableBean.attributes['onkeyup'].value}"
+
onmousedown="#{hDataTableBean.attributes['onmousedown'].value}"
+
onmousemove="#{hDataTableBean.attributes['onmousemove'].value}"
+
onmouseout="#{hDataTableBean.attributes['onmouseout'].value}"
+
onmouseover="#{hDataTableBean.attributes['onmouseover'].value}"
+
onmouseup="#{hDataTableBean.attributes['onmouseup'].value}"
+
rendered="#{hDataTableBean.attributes['rendered'].value}"
+
rowAvailable="#{hDataTableBean.attributes['rowAvailable'].value}"
+
rowClasses="#{hDataTableBean.attributes['rowClasses'].value}"
+
rowCount="#{hDataTableBean.attributes['rowCount'].value}"
+
rowData="#{hDataTableBean.attributes['rowData'].value}"
+
rows="#{hDataTableBean.attributes['rows'].value}"
+
rules="#{hDataTableBean.attributes['rules'].value}"
+
style="#{hDataTableBean.attributes['style'].value}"
+
styleClass="#{hDataTableBean.attributes['styleClass'].value}"
+
summary="#{hDataTableBean.attributes['summary'].value}"
+
title="#{hDataTableBean.attributes['title'].value}"
+ value="#{hDataTableBean.state ? model.capitals :
null}"
+ var="record"
+
width="#{hDataTableBean.attributes['width'].value}"
+ >
+
+ <f:facet name="caption">
+ <h:outputText id="captionFacet" value="Caption
Facet" />
+ </f:facet>
+
+ <f:facet name="header">
+ <h:outputText value="Header Facet" />
+ </f:facet>
+
+ <h:column id="columnState">
+ <f:facet name="header">
+ <h:outputText id="columnHeaderState"
value="State Header" />
+ </f:facet>
+
+ <h:outputText value="#{record.state}" />
+ <f:facet name="footer">
+ <h:outputText id="columnFooterState"
value="State Footer" />
+ </f:facet>
+ </h:column>
+
+ <h:column id="columnCapital">
+ <f:facet name="header">
+ <h:outputText id="columnHeaderCapital"
value="Capital Header" />
+ </f:facet>
+
+ <h:outputText value="#{record.name}" />
+ <f:facet name="footer">
+ <h:outputText id="columnFooterCapital"
value="Capital Footer" />
+ </f:facet>
+ </h:column>
+
+ <f:facet name="footer">
+ <h:outputText value="Footer Facet" />
+ </f:facet>
+
+ </h:dataTable>
+ </ui:define>
+
+ <ui:define name="outOfTemplateAfter">
+ <metamer:attributes value="#{hDataTableBean.attributes}"
id="attributes" />
+ </ui:define>
+
+ </ui:composition>
+</html>
\ No newline at end of file
Added:
modules/tests/metamer/trunk/application/src/main/webapp/resources/css/hDataTable.css
===================================================================
--- modules/tests/metamer/trunk/application/src/main/webapp/resources/css/hDataTable.css
(rev 0)
+++
modules/tests/metamer/trunk/application/src/main/webapp/resources/css/hDataTable.css 2010-08-11
13:39:54 UTC (rev 18552)
@@ -0,0 +1,11 @@
+.align-center {
+ text-align: center;
+}
+
+.align-left {
+ text-align: left;
+}
+
+.align-right {
+ text-align: right;
+}
\ No newline at end of file
Modified:
modules/tests/metamer/trunk/application/src/main/webapp/templates/template.xhtml
===================================================================
---
modules/tests/metamer/trunk/application/src/main/webapp/templates/template.xhtml 2010-08-11
13:22:43 UTC (rev 18551)
+++
modules/tests/metamer/trunk/application/src/main/webapp/templates/template.xhtml 2010-08-11
13:39:54 UTC (rev 18552)
@@ -23,8 +23,7 @@
<!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:ui="http://java.sun.com/jsf/facelets"
xmlns:a4j="http://richfaces.org/a4j"
-
xmlns:c="http://java.sun.com/jsp/jstl/core"
-
xmlns:f="http://java.sun.com/jsf/core">
+
xmlns:c="http://java.sun.com/jsp/jstl/core">
<h:head>
<title><ui:insert
name="pageTitle">Metamer</ui:insert></title>
@@ -40,7 +39,6 @@
<div class="content">
<div class="messages"><h:messages /></div>
-
<h:panelGroup id="commonGrid" layout="block"
rendered="#{richBean.reComponent}">
<c:choose>
<c:when test="#{dontRenderForm}">