Author: ppitonak(a)redhat.com
Date: 2011-04-05 11:58:59 -0400 (Tue, 05 Apr 2011)
New Revision: 22372
Modified:
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/Model.java
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/TemplateBean.java
modules/tests/metamer/trunk/application/src/main/webapp/components/a4jRepeat/keepSaved.xhtml
modules/tests/metamer/trunk/application/src/main/webapp/components/richCollapsibleSubTable/keepSaved.xhtml
modules/tests/metamer/trunk/application/src/main/webapp/components/richDataGrid/keepSaved.xhtml
modules/tests/metamer/trunk/application/src/main/webapp/components/richDataTable/keepSaved.xhtml
modules/tests/metamer/trunk/application/src/main/webapp/components/richExtendedDataTable/keepSaved.xhtml
modules/tests/metamer/trunk/application/src/main/webapp/components/richList/keepSaved.xhtml
modules/tests/metamer/trunk/application/src/main/webapp/templates/a4jRepeat1.xhtml
modules/tests/metamer/trunk/application/src/main/webapp/templates/a4jRepeat2.xhtml
modules/tests/metamer/trunk/application/src/main/webapp/templates/hDataTable1.xhtml
modules/tests/metamer/trunk/application/src/main/webapp/templates/hDataTable2.xhtml
modules/tests/metamer/trunk/application/src/main/webapp/templates/richDataTable1.xhtml
modules/tests/metamer/trunk/application/src/main/webapp/templates/richDataTable2.xhtml
modules/tests/metamer/trunk/application/src/main/webapp/templates/uiRepeat1.xhtml
modules/tests/metamer/trunk/application/src/main/webapp/templates/uiRepeat2.xhtml
Log:
model used in templates moved from TemplateBean to Model
Modified:
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/Model.java
===================================================================
---
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/Model.java 2011-04-05
15:58:00 UTC (rev 22371)
+++
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/Model.java 2011-04-05
15:58:59 UTC (rev 22372)
@@ -19,7 +19,6 @@
* 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;
@@ -29,6 +28,7 @@
import java.util.List;
import java.util.Set;
+import javax.annotation.PostConstruct;
import javax.faces.bean.ApplicationScoped;
import javax.faces.bean.ManagedBean;
import javax.faces.model.SelectItem;
@@ -54,13 +54,21 @@
public class Model implements Serializable {
private static final long serialVersionUID = 1L;
-
private List<Capital> capitalsList;
private List<Employee> employeesList;
private Set<String> jobTitles;
private List<SelectItem> jobTitlesSelectItems;
private List<CompactDiscXmlDescriptor> compactDiscList;
+ private List<String> simple = new ArrayList<String>();
+ @PostConstruct
+ public void init() {
+ simple.add("row 1");
+ simple.add("row 2");
+ simple.add("row 3");
+ simple.add("row 4");
+ }
+
/**
* Model containing US states, their capitals and timezones.
*
@@ -132,8 +140,7 @@
}
@SuppressWarnings("unchecked")
- static final <R, T extends ListHolder<R>> List<R>
unmarshall(Class<T> rootElementType, String resourceURL)
- throws JAXBException {
+ static <R, T extends ListHolder<R>> List<R>
unmarshall(Class<T> rootElementType, String resourceURL) throws JAXBException {
ClassLoader ccl = Thread.currentThread().getContextClassLoader();
URL resource = ccl.getResource(resourceURL);
JAXBContext context = JAXBContext.newInstance(rootElementType);
@@ -225,4 +232,8 @@
return jobTitlesSelectItems;
}
+
+ public List<String> getSimple() {
+ return simple;
+ }
}
Modified:
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/TemplateBean.java
===================================================================
---
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/TemplateBean.java 2011-04-05
15:58:00 UTC (rev 22371)
+++
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/TemplateBean.java 2011-04-05
15:58:59 UTC (rev 22372)
@@ -1,7 +1,7 @@
/*******************************************************************************
* JBoss, Home of Professional Open Source
* Copyright 2007, Exadel, Inc.,
- * 2010, Red Hat, Inc. and individual contributors
+ * 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.
*
@@ -20,7 +20,6 @@
* 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;
@@ -43,7 +42,6 @@
private static final long serialVersionUID = 5078700314562231363L;
private static Logger logger = LoggerFactory.getLogger(TemplateBean.class);
- private List<String> dataTableModel = new ArrayList<String>();
private TemplatesList templates;
private int templateIndex = 0;
private boolean renderForm;
@@ -51,11 +49,6 @@
@PostConstruct
public void init() {
templates = new TemplatesList();
- dataTableModel.add("row 1");
- dataTableModel.add("row 2");
- dataTableModel.add("row 3");
- dataTableModel.add("row 4");
-
renderForm = true;
}
@@ -77,9 +70,9 @@
this.templates.add(t);
}
}
-
+
public String getComponentPrefix() {
- StringBuffer prefix = new StringBuffer("form:");
+ StringBuilder prefix = new StringBuilder("form:");
for (Template template : templates) {
prefix.append(template.getNestedComponentPrefix());
}
@@ -95,13 +88,6 @@
return retVal;
}
- /**
- * @return the dataTableModel
- */
- public List<String> getDataTableModel() {
- return dataTableModel;
- }
-
public String getFirstTemplate() {
templateIndex = 0;
return templates.get(0).toString();
@@ -118,5 +104,4 @@
public void setRenderForm(boolean renderForm) {
this.renderForm = renderForm;
}
-
}
Modified:
modules/tests/metamer/trunk/application/src/main/webapp/components/a4jRepeat/keepSaved.xhtml
===================================================================
---
modules/tests/metamer/trunk/application/src/main/webapp/components/a4jRepeat/keepSaved.xhtml 2011-04-05
15:58:00 UTC (rev 22371)
+++
modules/tests/metamer/trunk/application/src/main/webapp/components/a4jRepeat/keepSaved.xhtml 2011-04-05
15:58:59 UTC (rev 22372)
@@ -54,7 +54,7 @@
<ui:define name="component">
<a4j:repeat id="richList"
keepSaved="#{a4jRepeatBean.attributes['keepSaved'].value}"
- value="#{templateBean.dataTableModel}">
+ value="#{model.simple}">
<h:inputText id="input"
value="#{maxBean.value}"/>
Modified:
modules/tests/metamer/trunk/application/src/main/webapp/components/richCollapsibleSubTable/keepSaved.xhtml
===================================================================
---
modules/tests/metamer/trunk/application/src/main/webapp/components/richCollapsibleSubTable/keepSaved.xhtml 2011-04-05
15:58:00 UTC (rev 22371)
+++
modules/tests/metamer/trunk/application/src/main/webapp/components/richCollapsibleSubTable/keepSaved.xhtml 2011-04-05
15:58:59 UTC (rev 22372)
@@ -59,7 +59,7 @@
</rich:column>
<rich:collapsibleSubTable id="richSubTable"
keepSaved="#{richSubTableBean.attributes['keepSaved'].value}"
-
value="#{templateBean.dataTableModel}" >
+ value="#{model.simple}" >
<rich:column id="columnInput">
<h:inputText id="input"
value="#{maxBean.value}"/>
Modified:
modules/tests/metamer/trunk/application/src/main/webapp/components/richDataGrid/keepSaved.xhtml
===================================================================
---
modules/tests/metamer/trunk/application/src/main/webapp/components/richDataGrid/keepSaved.xhtml 2011-04-05
15:58:00 UTC (rev 22371)
+++
modules/tests/metamer/trunk/application/src/main/webapp/components/richDataGrid/keepSaved.xhtml 2011-04-05
15:58:59 UTC (rev 22372)
@@ -52,7 +52,7 @@
<ui:define name="component">
<rich:dataGrid id="richDataGrid"
keepSaved="#{richDataGridBean.attributes['keepSaved'].value}"
- value="#{templateBean.dataTableModel}"
columns="2">
+ value="#{model.simple}" columns="2">
<rich:column id="columnInput">
<h:inputText id="input"
value="#{maxBean.value}"/>
Modified:
modules/tests/metamer/trunk/application/src/main/webapp/components/richDataTable/keepSaved.xhtml
===================================================================
---
modules/tests/metamer/trunk/application/src/main/webapp/components/richDataTable/keepSaved.xhtml 2011-04-05
15:58:00 UTC (rev 22371)
+++
modules/tests/metamer/trunk/application/src/main/webapp/components/richDataTable/keepSaved.xhtml 2011-04-05
15:58:59 UTC (rev 22372)
@@ -54,7 +54,7 @@
<ui:define name="component">
<rich:dataTable id="richDataTable"
keepSaved="#{richDataTableBean.attributes['keepSaved'].value}"
- value="#{templateBean.dataTableModel}" >
+ value="#{model.simple}" >
<rich:column id="columnInput">
<h:inputText id="input"
value="#{maxBean.value}"/>
Modified:
modules/tests/metamer/trunk/application/src/main/webapp/components/richExtendedDataTable/keepSaved.xhtml
===================================================================
---
modules/tests/metamer/trunk/application/src/main/webapp/components/richExtendedDataTable/keepSaved.xhtml 2011-04-05
15:58:00 UTC (rev 22371)
+++
modules/tests/metamer/trunk/application/src/main/webapp/components/richExtendedDataTable/keepSaved.xhtml 2011-04-05
15:58:59 UTC (rev 22372)
@@ -66,7 +66,7 @@
<ui:define name="component">
<rich:extendedDataTable id="richEDT"
keepSaved="#{richExtendedDataTableBean.attributes['keepSaved'].value}"
- value="#{templateBean.dataTableModel}"
>
+ value="#{model.simple}" >
<rich:column id="columnInput">
<h:inputText id="input"
value="#{maxBean.value}"/>
Modified:
modules/tests/metamer/trunk/application/src/main/webapp/components/richList/keepSaved.xhtml
===================================================================
---
modules/tests/metamer/trunk/application/src/main/webapp/components/richList/keepSaved.xhtml 2011-04-05
15:58:00 UTC (rev 22371)
+++
modules/tests/metamer/trunk/application/src/main/webapp/components/richList/keepSaved.xhtml 2011-04-05
15:58:59 UTC (rev 22372)
@@ -52,7 +52,7 @@
<ui:define name="component">
<rich:list id="richList"
keepSaved="#{richListBean.attributes['keepSaved'].value}"
- value="#{templateBean.dataTableModel}"
type="unordered">
+ value="#{model.simple}" type="unordered">
<h:inputText id="input"
value="#{maxBean.value}"/>
Modified:
modules/tests/metamer/trunk/application/src/main/webapp/templates/a4jRepeat1.xhtml
===================================================================
---
modules/tests/metamer/trunk/application/src/main/webapp/templates/a4jRepeat1.xhtml 2011-04-05
15:58:00 UTC (rev 22371)
+++
modules/tests/metamer/trunk/application/src/main/webapp/templates/a4jRepeat1.xhtml 2011-04-05
15:58:59 UTC (rev 22372)
@@ -28,7 +28,7 @@
<ui:composition>
<ul>
- <a4j:repeat value="#{templateBean.dataTableModel}"
var="containerA4JRepeatItem" id="containerA4JRepeat1">
+ <a4j:repeat value="#{model.simple}"
var="containerA4JRepeatItem" id="containerA4JRepeat1">
<li><h:panelGroup columns="1"
rendered="#{containerA4JRepeatItem == 'row 1'}">
<ui:decorate
template="#{templateBean.nextTemplate}.xhtml" />
</h:panelGroup>
Modified:
modules/tests/metamer/trunk/application/src/main/webapp/templates/a4jRepeat2.xhtml
===================================================================
---
modules/tests/metamer/trunk/application/src/main/webapp/templates/a4jRepeat2.xhtml 2011-04-05
15:58:00 UTC (rev 22371)
+++
modules/tests/metamer/trunk/application/src/main/webapp/templates/a4jRepeat2.xhtml 2011-04-05
15:58:59 UTC (rev 22372)
@@ -28,7 +28,7 @@
<ui:composition>
<ul>
- <a4j:repeat value="#{templateBean.dataTableModel}"
var="containerA4JRepeatItem" id="containerA4JRepeat2">
+ <a4j:repeat value="#{model.simple}"
var="containerA4JRepeatItem" id="containerA4JRepeat2">
<li><h:panelGroup columns="1"
rendered="#{containerA4JRepeatItem == 'row 2'}">
<ui:decorate
template="#{templateBean.nextTemplate}.xhtml" />
</h:panelGroup>
Modified:
modules/tests/metamer/trunk/application/src/main/webapp/templates/hDataTable1.xhtml
===================================================================
---
modules/tests/metamer/trunk/application/src/main/webapp/templates/hDataTable1.xhtml 2011-04-05
15:58:00 UTC (rev 22371)
+++
modules/tests/metamer/trunk/application/src/main/webapp/templates/hDataTable1.xhtml 2011-04-05
15:58:59 UTC (rev 22372)
@@ -27,7 +27,7 @@
<ui:composition>
- <h:dataTable value="#{templateBean.dataTableModel}"
var="containerHDataTableItem" id="containerHDataTable1">
+ <h:dataTable value="#{model.simple}"
var="containerHDataTableItem" id="containerHDataTable1">
<h:column>
<f:facet name="header">
<h:outputText value="JSF Data Table" />
Modified:
modules/tests/metamer/trunk/application/src/main/webapp/templates/hDataTable2.xhtml
===================================================================
---
modules/tests/metamer/trunk/application/src/main/webapp/templates/hDataTable2.xhtml 2011-04-05
15:58:00 UTC (rev 22371)
+++
modules/tests/metamer/trunk/application/src/main/webapp/templates/hDataTable2.xhtml 2011-04-05
15:58:59 UTC (rev 22372)
@@ -27,7 +27,7 @@
<ui:composition>
- <h:dataTable value="#{templateBean.dataTableModel}"
var="containerHDataTableItem" id="containerHDataTable1">
+ <h:dataTable value="#{model.simple}"
var="containerHDataTableItem" id="containerHDataTable1">
<h:column>
<f:facet name="header">
<h:outputText value="JSF Data Table" />
Modified:
modules/tests/metamer/trunk/application/src/main/webapp/templates/richDataTable1.xhtml
===================================================================
---
modules/tests/metamer/trunk/application/src/main/webapp/templates/richDataTable1.xhtml 2011-04-05
15:58:00 UTC (rev 22371)
+++
modules/tests/metamer/trunk/application/src/main/webapp/templates/richDataTable1.xhtml 2011-04-05
15:58:59 UTC (rev 22372)
@@ -27,7 +27,7 @@
<ui:composition>
- <rich:dataTable value="#{templateBean.dataTableModel}"
var="containerRichDataTableItem" id="containerRichDataTable1"
rowKeyVar="row">
+ <rich:dataTable value="#{model.simple}"
var="containerRichDataTableItem" id="containerRichDataTable1"
rowKeyVar="row">
<rich:column>
<f:facet name="header">
<h:outputText value="Rich Data Table" />
Modified:
modules/tests/metamer/trunk/application/src/main/webapp/templates/richDataTable2.xhtml
===================================================================
---
modules/tests/metamer/trunk/application/src/main/webapp/templates/richDataTable2.xhtml 2011-04-05
15:58:00 UTC (rev 22371)
+++
modules/tests/metamer/trunk/application/src/main/webapp/templates/richDataTable2.xhtml 2011-04-05
15:58:59 UTC (rev 22372)
@@ -27,7 +27,7 @@
<ui:composition>
- <rich:dataTable value="#{templateBean.dataTableModel}"
var="containerRichDataTableItem" id="containerRichDataTable2"
rowKeyVar="row">
+ <rich:dataTable value="#{model.simple}"
var="containerRichDataTableItem" id="containerRichDataTable2"
rowKeyVar="row">
<rich:column>
<f:facet name="header">
<h:outputText value="Rich Data Table" />
Modified:
modules/tests/metamer/trunk/application/src/main/webapp/templates/uiRepeat1.xhtml
===================================================================
---
modules/tests/metamer/trunk/application/src/main/webapp/templates/uiRepeat1.xhtml 2011-04-05
15:58:00 UTC (rev 22371)
+++
modules/tests/metamer/trunk/application/src/main/webapp/templates/uiRepeat1.xhtml 2011-04-05
15:58:59 UTC (rev 22372)
@@ -27,7 +27,7 @@
<ui:composition>
<ol>
- <ui:repeat value="#{templateBean.dataTableModel}"
var="containerUiRepeatItem" id="containerUiRepeat1">
+ <ui:repeat value="#{model.simple}"
var="containerUiRepeatItem" id="containerUiRepeat1">
<li><h:panelGroup columns="1"
rendered="#{containerUiRepeatItem == 'row 1'}">
<ui:decorate
template="#{templateBean.nextTemplate}.xhtml" />
</h:panelGroup>
Modified:
modules/tests/metamer/trunk/application/src/main/webapp/templates/uiRepeat2.xhtml
===================================================================
---
modules/tests/metamer/trunk/application/src/main/webapp/templates/uiRepeat2.xhtml 2011-04-05
15:58:00 UTC (rev 22371)
+++
modules/tests/metamer/trunk/application/src/main/webapp/templates/uiRepeat2.xhtml 2011-04-05
15:58:59 UTC (rev 22372)
@@ -28,7 +28,7 @@
<ui:composition>
<ol>
- <ui:repeat value="#{templateBean.dataTableModel}"
var="containerUiRepeatItem" id="containerUiRepeat2">
+ <ui:repeat value="#{model.simple}"
var="containerUiRepeatItem" id="containerUiRepeat2">
<li><h:panelGroup columns="1"
rendered="#{containerUiRepeatItem == 'row 2'}">
<ui:decorate
template="#{templateBean.nextTemplate}.xhtml" />
</h:panelGroup>