JBoss Rich Faces SVN: r22487 - modules/tests/metamer/trunk/application/src/main/webapp/components/richGraphValidator.
by richfaces-svn-commits@lists.jboss.org
Author: jjamrich
Date: 2011-05-15 21:10:44 -0400 (Sun, 15 May 2011)
New Revision: 22487
Modified:
modules/tests/metamer/trunk/application/src/main/webapp/components/richGraphValidator/all.xhtml
Log:
Set id for submit button in graphValidator example
Modified: modules/tests/metamer/trunk/application/src/main/webapp/components/richGraphValidator/all.xhtml
===================================================================
--- modules/tests/metamer/trunk/application/src/main/webapp/components/richGraphValidator/all.xhtml 2011-05-12 10:35:39 UTC (rev 22486)
+++ modules/tests/metamer/trunk/application/src/main/webapp/components/richGraphValidator/all.xhtml 2011-05-16 01:10:44 UTC (rev 22487)
@@ -153,8 +153,9 @@
<rich:message for="selectOneRadio" />
</h:panelGrid>
- <a4j:commandButton value="Apply changes"
- action="#{richGraphValidatorBean.anotherActionOnAllComponents}" />
+ <a4j:commandButton id="applyChanges"
+ value="Apply changes"
+ action="#{richGraphValidatorBean.anotherActionOnAllComponents}" />
</rich:panel>
</rich:graphValidator>
</ui:fragment>
13 years, 7 months
JBoss Rich Faces SVN: r22486 - modules/tests/metamer/trunk/application/src/main/webapp/components/richTab.
by richfaces-svn-commits@lists.jboss.org
Author: jjamrich
Date: 2011-05-12 06:35:39 -0400 (Thu, 12 May 2011)
New Revision: 22486
Added:
modules/tests/metamer/trunk/application/src/main/webapp/components/richTab/withA4j.xhtml
Modified:
modules/tests/metamer/trunk/application/src/main/webapp/components/richTab/list.xhtml
Log:
Add demonstration problem with a4j:ajax within rich:tab
Add some different a4j:ajax with actionListener within rich:tab.
Demonstrate issue with firing-up event bound to tab.
Modified: modules/tests/metamer/trunk/application/src/main/webapp/components/richTab/list.xhtml
===================================================================
--- modules/tests/metamer/trunk/application/src/main/webapp/components/richTab/list.xhtml 2011-05-11 20:46:51 UTC (rev 22485)
+++ modules/tests/metamer/trunk/application/src/main/webapp/components/richTab/list.xhtml 2011-05-12 10:35:39 UTC (rev 22486)
@@ -34,6 +34,10 @@
<metamer:testPageLink id="simple" outcome="simple" value="Simple">
Simple page containing rich:tabPanel with several <b>rich:tab</b>s and input boxes for all its attributes.
</metamer:testPageLink>
+
+ <metamer:testPageLink id="withA4j" outcome="withA4j" value="With a4j">
+ Simple page containing rich:tabPanel with several <b>rich:tab</b>s and a4j:ajax
+ </metamer:testPageLink>
</ui:define>
Added: modules/tests/metamer/trunk/application/src/main/webapp/components/richTab/withA4j.xhtml
===================================================================
--- modules/tests/metamer/trunk/application/src/main/webapp/components/richTab/withA4j.xhtml (rev 0)
+++ modules/tests/metamer/trunk/application/src/main/webapp/components/richTab/withA4j.xhtml 2011-05-12 10:35:39 UTC (rev 22486)
@@ -0,0 +1,135 @@
+<?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:metamer="http://java.sun.com/jsf/composite/metamer"
+ xmlns:rich="http://richfaces.org/rich" xmlns:a4j="http://richfaces.org/a4j" >
+
+ <!--
+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: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="component">
+
+ <rich:tabPanel id="tabPanel" itemChangeListener="#{richBean.itemChangeListener}" >
+
+ <rich:tab id="tab1"
+ action="#{richBean.dummyAction}"
+ actionListener="#{richBean.actionListener}"
+
+ contentClass="#{richTabBean.attributes['contentClass'].value}"
+ bypassUpdates="#{richTabBean.attributes['bypassUpdates'].value}"
+ dir="#{richTabBean.attributes['dir'].value}"
+ disabled="#{richTabBean.attributes['disabled'].value}"
+ header="#{richTabBean.attributes['header'].value}"
+ headerClass="#{richTabBean.attributes['headerClass'].value}"
+ headerActiveClass="#{richTabBean.attributes['headerActiveClass'].value}"
+ headerDisabledClass="#{richTabBean.attributes['headerDisabledClass'].value}"
+ headerInactiveClass="#{richTabBean.attributes['headerInactiveClass'].value}"
+ headerStyle="#{richTabBean.attributes['headerStyle'].value}"
+ immediate="#{richTabBean.attributes['immediate'].value}"
+ lang="#{richTabBean.attributes['lang'].value}"
+ name="#{richTabBean.attributes['name'].value}"
+ onclick="#{richTabBean.attributes['onclick'].value}"
+ ondblclick="#{richTabBean.attributes['ondblclick'].value}"
+ onenter="#{richTabBean.attributes['onenter'].value}"
+ onheaderclick="#{richTabBean.attributes['onheaderclick'].value}"
+ onheaderdblclick="#{richTabBean.attributes['onheaderdblclick'].value}"
+ onheadermousedown="#{richTabBean.attributes['onheadermousedown'].value}"
+ onheadermousemove="#{richTabBean.attributes['onheadermousemove'].value}"
+ onheadermouseup="#{richTabBean.attributes['onheadermouseup'].value}"
+ onleave="#{richTabBean.attributes['onleave'].value}"
+ onmousedown="#{richTabBean.attributes['onmousedown'].value}"
+ onmousemove="#{richTabBean.attributes['onmousemove'].value}"
+ onmouseout="#{richTabBean.attributes['onmouseout'].value}"
+ onmouseover="#{richTabBean.attributes['onmouseover'].value}"
+ onmouseup="#{richTabBean.attributes['onmouseup'].value}"
+ rendered="#{richTabBean.attributes['rendered'].value}"
+ style="#{richTabBean.attributes['style'].value}"
+ styleClass="#{richTabBean.attributes['styleClass'].value}"
+ switchType="#{richTabBean.attributes['switchType'].value}"
+ title="#{richTabBean.attributes['title'].value}" >
+ <a4j:ajax
+ event="click"
+ listener="#{richBean.actionListener}" />
+ content of tab 1
+ </rich:tab>
+ <rich:tab id="tab2" name="tab2" header="tab2 header"
+ switchType="#{richTabBean.attributes['switchType'].value}">
+ content of tab 2
+ <a4j:ajax
+ event="enter"
+ listener="#{richBean.actionListener}" />
+ </rich:tab>
+ <rich:tab id="tab3" name="tab3" header="tab3 header"
+ switchType="#{richTabBean.attributes['switchType'].value}" >
+ content of tab 3
+ <a4j:ajax
+ event="click"
+ listener="#{richBean.actionListener}" />
+ </rich:tab>
+ <rich:tab id="tab4" name="tab4" header="tab4 header" disabled="true"
+ switchType="#{richTabBean.attributes['switchType'].value}">
+ content of tab 4
+ </rich:tab>
+ <rich:tab id="tab5" name="tab5" header="tab5 header"
+ switchType="#{richTabBean.attributes['switchType'].value}">
+ content of tab 5
+ </rich:tab>
+ </rich:tabPanel>
+
+ <br/><br/>
+
+ <h:commandButton id="firstTabButton" value="First tab">
+ <rich:toggleControl targetPanel="tabPanel" targetItem="@first" />
+ </h:commandButton>
+ <h:commandButton id="prevTabButton" value="Previous tab">
+ <rich:toggleControl targetPanel="tabPanel" targetItem="@prev" />
+ </h:commandButton>
+ <h:commandButton id="nextTabButton" value="Next tab">
+ <rich:toggleControl targetPanel="tabPanel" targetItem="@next" />
+ </h:commandButton>
+ <h:commandButton id="lastTabButton" value="Last tab">
+ <rich:toggleControl targetPanel="tabPanel" targetItem="@last" />
+ </h:commandButton>
+ <h:commandButton id="customTabButton" value="Custon tab (#{richTabBean.attributes['name'].value})">
+ <rich:toggleControl targetPanel="tabPanel" targetItem="#{richTabBean.attributes['name'].value}" />
+ </h:commandButton>
+
+
+ </ui:define>
+
+ <ui:define name="outOfTemplateAfter">
+ Attributes for the first tab:
+ <metamer:attributes value="#{richTabBean.attributes}" id="attributes" render="log"/>
+ </ui:define>
+
+ </ui:composition>
+</html>
\ No newline at end of file
13 years, 7 months
JBoss Rich Faces SVN: r22485 - in trunk/examples/richfaces-showcase/src/main/webapp/richfaces/dataTable: samples and 1 other directory.
by richfaces-svn-commits@lists.jboss.org
Author: ilya_shaikovsky
Date: 2011-05-11 16:46:51 -0400 (Wed, 11 May 2011)
New Revision: 22485
Modified:
trunk/examples/richfaces-showcase/src/main/webapp/richfaces/dataTable/arrangeableModel.xhtml
trunk/examples/richfaces-showcase/src/main/webapp/richfaces/dataTable/samples/jpaColumn.xhtml
Log:
https://issues.jboss.org/browse/RF-10845 - descriptioon and sources links
Modified: trunk/examples/richfaces-showcase/src/main/webapp/richfaces/dataTable/arrangeableModel.xhtml
===================================================================
--- trunk/examples/richfaces-showcase/src/main/webapp/richfaces/dataTable/arrangeableModel.xhtml 2011-05-11 20:37:14 UTC (rev 22484)
+++ trunk/examples/richfaces-showcase/src/main/webapp/richfaces/dataTable/arrangeableModel.xhtml 2011-05-11 20:46:51 UTC (rev 22485)
@@ -5,7 +5,48 @@
xmlns:ui="http://java.sun.com/jsf/facelets">
<ui:composition>
- <p>DESC</p>
+ <p>That sample shows you <b>ArrangeableModel </b>implementation in order
+ to perform in-db sorting filtering and paging of the data</p>
+ <p>While exploring sources pay most attention to <b>JPADataModel </b>which
+ is actually generic abstract model which have most of the functionality
+ implemented.</p>
+ <p><b>PersonBean </b>provides the sorting/filtering controller and
+ instantiates concrete model for Person entity</p>
+ <p>We using JPA and Hibernate entity manager in order to work with
+ the db.</p>
<ui:include src="#{demoNavigator.sampleIncludeURI}" />
+ <ui:include src="/templates/includes/source-view.xhtml">
+ <ui:param name="src" value="#{demoNavigator.sampleIncludeURI}" />
+ <ui:param name="sourceType" value="xhtml" />
+ <ui:param name="openLabel" value="View Page Source" />
+ <ui:param name="hideLabel" value="Hide Page Source" />
+ </ui:include>
+ <ui:include src="/templates/includes/source-view.xhtml">
+ <ui:param name="src" value="/richfaces/dataTable/samples/jpaColumn.xhtml" />
+ <ui:param name="sourceType" value="xhtml" />
+ <ui:param name="openLabel" value="View jpaColumn.xhtml Source" />
+ <ui:param name="hideLabel" value="Hide jpaColumn.xhtml Source" />
+ </ui:include>
+ <ui:include src="/templates/includes/source-view.xhtml">
+ <ui:param name="src"
+ value="/WEB-INF/src/org/richfaces/demo/arrangeablemodel/JPADataModel.java" />
+ <ui:param name="sourceType" value="java" />
+ <ui:param name="openLabel" value="View JPADataModel Source" />
+ <ui:param name="hideLabel" value="Hide JPADataModel Source" />
+ </ui:include>
+ <ui:include src="/templates/includes/source-view.xhtml">
+ <ui:param name="src"
+ value="/WEB-INF/src/org/richfaces/demo/arrangeablemodel/PersonBean.java" />
+ <ui:param name="sourceType" value="java" />
+ <ui:param name="openLabel" value="View PersonBean Source" />
+ <ui:param name="hideLabel" value="Hide PersonBean Source" />
+ </ui:include>
+ <ui:include src="/templates/includes/source-view.xhtml">
+ <ui:param name="src"
+ value="/WEB-INF/src/org/richfaces/demo/arrangeablemodel/Person.java" />
+ <ui:param name="sourceType" value="java" />
+ <ui:param name="openLabel" value="View Person Source" />
+ <ui:param name="hideLabel" value="Hide Person Source" />
+ </ui:include>
</ui:composition>
</html>
Modified: trunk/examples/richfaces-showcase/src/main/webapp/richfaces/dataTable/samples/jpaColumn.xhtml
===================================================================
--- trunk/examples/richfaces-showcase/src/main/webapp/richfaces/dataTable/samples/jpaColumn.xhtml 2011-05-11 20:37:14 UTC (rev 22484)
+++ trunk/examples/richfaces-showcase/src/main/webapp/richfaces/dataTable/samples/jpaColumn.xhtml 2011-05-11 20:46:51 UTC (rev 22485)
@@ -12,9 +12,8 @@
sortOrder="#{bean.sortOrders[property]}"
filterValue="#{bean.filterValues[property]}"
filterExpression="#{property}">
-
<f:facet name="header">
- <h:commandLink style="color: white;" action="#{bean.toggleSort}">
+ <h:commandLink action="#{bean.toggleSort}">
#{bean.sortOrders[property]}
<a4j:ajax render="richTable" />
<f:setPropertyActionListener target="#{bean.sortProperty}" value="#{property}" />
@@ -24,7 +23,6 @@
<a4j:ajax render="richTable@body scroller" event="keyup" />
</h:inputText>
</f:facet>
-
<h:outputText value="#{record[property]}" />
</rich:column>
</ui:composition>
13 years, 7 months
JBoss Rich Faces SVN: r22484 - in branches/4.0.X/examples/richfaces-showcase/src/main/webapp/richfaces/dataTable: samples and 1 other directory.
by richfaces-svn-commits@lists.jboss.org
Author: ilya_shaikovsky
Date: 2011-05-11 16:37:14 -0400 (Wed, 11 May 2011)
New Revision: 22484
Modified:
branches/4.0.X/examples/richfaces-showcase/src/main/webapp/richfaces/dataTable/arrangeableModel.xhtml
branches/4.0.X/examples/richfaces-showcase/src/main/webapp/richfaces/dataTable/samples/jpaColumn.xhtml
Log:
https://issues.jboss.org/browse/RF-10845 - descriptioon and sources links
Modified: branches/4.0.X/examples/richfaces-showcase/src/main/webapp/richfaces/dataTable/arrangeableModel.xhtml
===================================================================
--- branches/4.0.X/examples/richfaces-showcase/src/main/webapp/richfaces/dataTable/arrangeableModel.xhtml 2011-05-11 20:19:49 UTC (rev 22483)
+++ branches/4.0.X/examples/richfaces-showcase/src/main/webapp/richfaces/dataTable/arrangeableModel.xhtml 2011-05-11 20:37:14 UTC (rev 22484)
@@ -5,7 +5,48 @@
xmlns:ui="http://java.sun.com/jsf/facelets">
<ui:composition>
- <p>DESC</p>
+ <p>That sample shows you <b>ArrangeableModel </b>implementation in order
+ to perform in-db sorting filtering and paging of the data</p>
+ <p>While exploring sources pay most attention to <b>JPADataModel </b>which
+ is actually generic abstract model which have most of the functionality
+ implemented.</p>
+ <p><b>PersonBean </b>provides the sorting/filtering controller and
+ instantiates concrete model for Person entity</p>
+ <p>We using JPA and Hibernate entity manager in order to work with
+ the db.</p>
<ui:include src="#{demoNavigator.sampleIncludeURI}" />
+ <ui:include src="/templates/includes/source-view.xhtml">
+ <ui:param name="src" value="#{demoNavigator.sampleIncludeURI}" />
+ <ui:param name="sourceType" value="xhtml" />
+ <ui:param name="openLabel" value="View Page Source" />
+ <ui:param name="hideLabel" value="Hide Page Source" />
+ </ui:include>
+ <ui:include src="/templates/includes/source-view.xhtml">
+ <ui:param name="src" value="/richfaces/dataTable/samples/jpaColumn.xhtml" />
+ <ui:param name="sourceType" value="xhtml" />
+ <ui:param name="openLabel" value="View jpaColumn.xhtml Source" />
+ <ui:param name="hideLabel" value="Hide jpaColumn.xhtml Source" />
+ </ui:include>
+ <ui:include src="/templates/includes/source-view.xhtml">
+ <ui:param name="src"
+ value="/WEB-INF/src/org/richfaces/demo/arrangeablemodel/JPADataModel.java" />
+ <ui:param name="sourceType" value="java" />
+ <ui:param name="openLabel" value="View JPADataModel Source" />
+ <ui:param name="hideLabel" value="Hide JPADataModel Source" />
+ </ui:include>
+ <ui:include src="/templates/includes/source-view.xhtml">
+ <ui:param name="src"
+ value="/WEB-INF/src/org/richfaces/demo/arrangeablemodel/PersonBean.java" />
+ <ui:param name="sourceType" value="java" />
+ <ui:param name="openLabel" value="View PersonBean Source" />
+ <ui:param name="hideLabel" value="Hide PersonBean Source" />
+ </ui:include>
+ <ui:include src="/templates/includes/source-view.xhtml">
+ <ui:param name="src"
+ value="/WEB-INF/src/org/richfaces/demo/arrangeablemodel/Person.java" />
+ <ui:param name="sourceType" value="java" />
+ <ui:param name="openLabel" value="View Person Source" />
+ <ui:param name="hideLabel" value="Hide Person Source" />
+ </ui:include>
</ui:composition>
</html>
Modified: branches/4.0.X/examples/richfaces-showcase/src/main/webapp/richfaces/dataTable/samples/jpaColumn.xhtml
===================================================================
--- branches/4.0.X/examples/richfaces-showcase/src/main/webapp/richfaces/dataTable/samples/jpaColumn.xhtml 2011-05-11 20:19:49 UTC (rev 22483)
+++ branches/4.0.X/examples/richfaces-showcase/src/main/webapp/richfaces/dataTable/samples/jpaColumn.xhtml 2011-05-11 20:37:14 UTC (rev 22484)
@@ -12,9 +12,8 @@
sortOrder="#{bean.sortOrders[property]}"
filterValue="#{bean.filterValues[property]}"
filterExpression="#{property}">
-
<f:facet name="header">
- <h:commandLink style="color: white;" action="#{bean.toggleSort}">
+ <h:commandLink action="#{bean.toggleSort}">
#{bean.sortOrders[property]}
<a4j:ajax render="richTable" />
<f:setPropertyActionListener target="#{bean.sortProperty}" value="#{property}" />
@@ -24,7 +23,6 @@
<a4j:ajax render="richTable@body scroller" event="keyup" />
</h:inputText>
</f:facet>
-
<h:outputText value="#{record[property]}" />
</rich:column>
</ui:composition>
13 years, 7 months
JBoss Rich Faces SVN: r22483 - in modules/tests/metamer/trunk/application/src/main: webapp/components/richGraphValidator and 1 other directory.
by richfaces-svn-commits@lists.jboss.org
Author: jjamrich
Date: 2011-05-11 16:19:49 -0400 (Wed, 11 May 2011)
New Revision: 22483
Removed:
modules/tests/metamer/trunk/application/src/main/webapp/components/richGraphValidator/jsr303.xhtml
Modified:
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/rich/RichGraphValidatorBean.java
modules/tests/metamer/trunk/application/src/main/webapp/components/richGraphValidator/all.xhtml
Log:
Add autocompletion and calendar into metamer within graphValidator
Modified: modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/rich/RichGraphValidatorBean.java
===================================================================
--- modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/rich/RichGraphValidatorBean.java 2011-05-10 20:05:31 UTC (rev 22482)
+++ modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/rich/RichGraphValidatorBean.java 2011-05-11 20:19:49 UTC (rev 22483)
@@ -23,6 +23,8 @@
import java.io.Serializable;
import java.util.ArrayList;
+import java.util.Date;
+import java.util.Iterator;
import java.util.List;
import javax.annotation.PostConstruct;
@@ -106,6 +108,8 @@
@NotNull
@NotEmpty
private String selectOneRadio = smile;
+ @NotNull
+ private Date calendar = new Date(System.currentTimeMillis());
@PostConstruct
public void init(){
@@ -118,7 +122,7 @@
}
@AssertTrue(message = "One of following inputs doesn't contain smile or numeric value "
- + REQUIRED_INT_VALUE + "!",
+ + REQUIRED_INT_VALUE + " or date is from future!",
groups = {Default.class, ValidationGroupAllComponents.class})
public boolean isAllInputsCorrect() {
@@ -137,7 +141,8 @@
&& !selectManyListbox.isEmpty()
&& selectOneMenu.contains(smile)
&& !selectManyMenu.isEmpty()
- && selectOneRadio.contains(smile);
+ && selectOneRadio.contains(smile)
+ && !calendar.after(new Date(System.currentTimeMillis()));
}
@AssertTrue(message = "One of following numeric inputs doesn't contain value "
@@ -170,6 +175,27 @@
return result;
}
+ public List<String> autocomplete(String prefix) {
+ ArrayList<String> result = new ArrayList<String>();
+ if ((prefix == null) || (prefix.length() == 0)) {
+ for (int i = 0; i < 10; i++) {
+ result.add(getSelectItems().get(i).getLabel());
+ }
+
+ } else {
+ Iterator<SelectItem> iterator = selectItems.iterator();
+ while (iterator.hasNext()) {
+ SelectItem elem = ((SelectItem) iterator.next());
+ if ((elem.getLabel() != null && elem.getLabel().toLowerCase().indexOf(prefix.toLowerCase()) == 0)
+ || "".equals(prefix)) {
+ result.add(elem.getLabel());
+ }
+ }
+ }
+
+ return result;
+ }
+
public Class<?>[] getValidationGroups() throws ClassNotFoundException {
Attribute groups = attributes.get("groups");
Class<?> group;
@@ -327,4 +353,12 @@
public void setSelectOneRadio(String selectOneRadio) {
this.selectOneRadio = selectOneRadio;
}
+
+ public Date getCalendar() {
+ return calendar;
+ }
+
+ public void setCalendar(Date calendar) {
+ this.calendar = calendar;
+ }
}
Modified: modules/tests/metamer/trunk/application/src/main/webapp/components/richGraphValidator/all.xhtml
===================================================================
--- modules/tests/metamer/trunk/application/src/main/webapp/components/richGraphValidator/all.xhtml 2011-05-10 20:05:31 UTC (rev 22482)
+++ modules/tests/metamer/trunk/application/src/main/webapp/components/richGraphValidator/all.xhtml 2011-05-11 20:19:49 UTC (rev 22483)
@@ -58,27 +58,26 @@
groups="#{richGraphValidatorBean.validationGroups}"
type="#{richGraphValidatorBean.attributes['type'].value}"
rendered="#{richGraphValidatorBean.attributes['rendered'].value}" >
- <rich:panel header="Many rich components within rich:graphValidator" style="width:500px">
+ <rich:panel header="Many rich components within rich:graphValidator" style="width:800px">
<rich:messages for="gv1" />
<rich:messages globalOnly="true" />
- <h:panelGrid columns="3">
+ <h:panelGrid columns="6">
<h:outputText for="inplaceSelect" value="Inplace Select" />
- <rich:inplaceSelect id="inplaceSelect" value="#{richGraphValidatorBean.inplaceSelect}"
- defaultLabel="Write smile here..." >
+ <rich:inplaceSelect id="inplaceSelect" value="#{richGraphValidatorBean.inplaceSelect}" >
<f:selectItems value="#{richGraphValidatorBean.selectItems}" />
</rich:inplaceSelect>
<rich:message for="inplaceSelect" />
- <h:outputText for="inplaceInput" value="Inplace Input" />
- <rich:inplaceInput id="inplaceInput" value="#{richGraphValidatorBean.inplaceInput}" />
- <rich:message for="inplaceInput" />
-
<h:outputText for="select" value="Select" />
<rich:select id="select" value="#{richGraphValidatorBean.select}" >
<f:selectItems value="#{richGraphValidatorBean.selectItems}" />
</rich:select>
<rich:message for="select" />
+ <h:outputText for="inplaceInput" value="Inplace Input" />
+ <rich:inplaceInput id="inplaceInput" value="#{richGraphValidatorBean.inplaceInput}" />
+ <rich:message for="inplaceInput" />
+
<h:outputText for="inputNumberSlider" value="Input Number Slider" />
<rich:inputNumberSlider id="inputNumberSlider" value="#{richGraphValidatorBean.inputNumberSlider}" />
<rich:message for="inputNumberSlider" />
@@ -88,9 +87,14 @@
<rich:message for="inputNumberSpinner" />
<h:outputText for="autocomplete" value="Autocomplete" />
- <rich:autocomplete id="autocomplete" value="#{richGraphValidatorBean.autocompleteInput}" />
+ <rich:autocomplete id="autocomplete" value="#{richGraphValidatorBean.autocompleteInput}"
+ autocompleteMethod="#{richGraphValidatorBean.autocomplete}" />
<rich:message for="autocomplete" />
+ <h:outputText for="selectBooleanCheckbox" value="Select Boolean Checkbox" />
+ <h:selectBooleanCheckbox id="selectBooleanCheckbox" value="#{richGraphValidatorBean.selectBooleanCheckbox}" />
+ <rich:message for="selectBooleanCheckbox" />
+
<h:outputText for="inputText" value="Input Text" />
<h:inputText id="inputText" value="#{richGraphValidatorBean.inputText}" />
<rich:message for="inputText" />
@@ -99,13 +103,23 @@
<h:inputSecret id="inputSecret" value="#{richGraphValidatorBean.inputSecret}" />
<rich:message for="inputSecret" />
+ <h:outputText for="calendar" value="Calendar" />
+ <rich:calendar id="calendar" value="#{richGraphValidatorBean.calendar}" />
+ <rich:message for="calendar" />
+
+ <h:column/>
+ <h:column/>
+ <h:column/>
+
<h:outputText for="inputTextarea" value="Input Text Area" />
<h:inputTextarea id="inputTextarea" value="#{richGraphValidatorBean.inputTextarea}" />
<rich:message for="inputTextarea" />
- <h:outputText for="selectBooleanCheckbox" value="Select Boolean Checkbox" />
- <h:selectBooleanCheckbox id="selectBooleanCheckbox" value="#{richGraphValidatorBean.selectBooleanCheckbox}" />
- <rich:message for="selectBooleanCheckbox" />
+ <h:outputText for="selectOneListbox" value="Select One Listbox" />
+ <h:selectOneListbox id="selectOneListbox" value="#{richGraphValidatorBean.selectOneListbox}" >
+ <f:selectItems value="#{richGraphValidatorBean.selectItems}" />
+ </h:selectOneListbox>
+ <rich:message for="selectOneListbox" />
<h:outputText for="selectManyCheckbox" value="Select Many Checkbox" />
<h:selectManyCheckbox id="selectManyCheckbox"
@@ -114,12 +128,6 @@
</h:selectManyCheckbox>
<rich:message for="selectManyCheckbox" />
- <h:outputText for="selectOneListbox" value="Select One Listbox" />
- <h:selectOneListbox id="selectOneListbox" value="#{richGraphValidatorBean.selectOneListbox}" >
- <f:selectItems value="#{richGraphValidatorBean.selectItems}" />
- </h:selectOneListbox>
- <rich:message for="selectOneListbox" />
-
<h:outputText for="selectManyListbox" value="Select Many Listbox" />
<h:selectManyListbox id="selectManyListbox" value="#{richGraphValidatorBean.selectManyListbox}" >
<f:selectItems value="#{richGraphValidatorBean.selectItems}" />
Deleted: modules/tests/metamer/trunk/application/src/main/webapp/components/richGraphValidator/jsr303.xhtml
===================================================================
--- modules/tests/metamer/trunk/application/src/main/webapp/components/richGraphValidator/jsr303.xhtml 2011-05-10 20:05:31 UTC (rev 22482)
+++ modules/tests/metamer/trunk/application/src/main/webapp/components/richGraphValidator/jsr303.xhtml 2011-05-11 20:19:49 UTC (rev 22483)
@@ -1,135 +0,0 @@
-<?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:rich="http://richfaces.org/rich"
- xmlns:metamer="http://java.sun.com/jsf/composite/metamer">
-
-<!--
-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: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">
- <style type="text/css">
- .rf-msg-err {
- display: block !important;
- margin-bottom: 6px;
- }
- </style>
- </ui:define>
-
- <ui:define name="component">
- <script type="text/javascript">
- function setCorrectValues() {
- $('input[id$=pass1]').val('rfvokm334lafd');
- $('input[id$=conf1]').val('rfvokm334lafd');
- }
-
- function setWrongValues() {
- $('input[id$=pass1]').val('rfvdthrfd');
- $('input[id$=conf1]').val('dsararaAqa');
- }
- </script>
-
- <h:form>
- <input id="setCorrectValuesButton" type="button" value="set correct values" onclick="setCorrectValues()"/>
- <input id="setWrongValuesButton" type="button" value="set wrong values" onclick="setWrongValues()"/>
-
- <br/>
-
- <ui:fragment rendered="#{richGraphValidatorBean.attributes['summary'].value==null
- || richGraphValidatorBean.attributes['summary'].value==''}" >
- <rich:graphValidator id="gv1"
- value="#{richGraphValidatorBean}"
- groups="#{richGraphValidatorBean.attributes['groups'].value}"
- type="#{richGraphValidatorBean.attributes['type'].value}"
- rendered="#{richGraphValidatorBean.attributes['rendered'].value}" >
- <rich:panel header="Change password" style="width:500px">
- <rich:messages for="gv1" />
- <rich:messages globalOnly="true" />
- <h:panelGrid columns="3">
- <h:outputText value="Enter new password:" />
- <h:inputSecret value="#{richGraphValidatorBean.password}" id="pass1" />
- <rich:message for="pass1" />
- <h:outputText value="Confirm the new password:" />
- <h:inputSecret value="#{richGraphValidatorBean.passwordConfirm}" id="conf1" />
- <rich:message for="conf1" />
- </h:panelGrid>
- <a4j:commandButton value="Store changes"
- action="#{richGraphValidatorBean.storeNewPassword}" />
- </rich:panel>
- </rich:graphValidator>
- </ui:fragment>
-
- <ui:fragment rendered="#{richGraphValidatorBean.attributes['summary'].value!=null
- && richGraphValidatorBean.attributes['summary'].value!=''}" >
- <rich:graphValidator id="gv2"
- value="#{richGraphValidatorBean}"
- groups="#{richGraphValidatorBean.attributes['groups'].value}"
- rendered="#{richGraphValidatorBean.attributes['rendered'].value}"
- summary="#{richGraphValidatorBean.attributes['summary'].value}"
- type="#{richGraphValidatorBean.attributes['type'].value}" >
- <rich:panel header="Change password" style="width:500px">
- <rich:messages for="gv2" />
- <rich:messages globalOnly="true" />
- <h:panelGrid columns="3">
- <h:outputText value="Enter new password:" />
- <h:inputSecret value="#{richGraphValidatorBean.password}"
- id="pass2" />
- <rich:message for="pass2" />
- <h:outputText value="Confirm the new password:" />
- <h:inputSecret value="#{richGraphValidatorBean.passwordConfirm}"
- id="conf2" />
- <rich:message for="conf2" />
- </h:panelGrid>
- <a4j:commandButton value="Store changes"
- action="#{richGraphValidatorBean.storeNewPassword}" />
- </rich:panel>
- </rich:graphValidator>
- </ui:fragment>
-
- </h:form>
-
- <br />
- <rich:messages id="msgs" value="#{richGraphValidatorBean}" />
-
- </ui:define>
-
- <ui:define name="outOfTemplateAfter">
- <metamer:attributes value="#{richGraphValidatorBean.attributes}"
- id="attributes" />
- </ui:define>
-
-</ui:composition>
-</html>
\ No newline at end of file
13 years, 7 months
JBoss Rich Faces SVN: r22481 - in modules/tests/metamer/trunk/application/src/main: java/org/richfaces/tests/metamer/validation/groups and 2 other directories.
by richfaces-svn-commits@lists.jboss.org
Author: jjamrich
Date: 2011-05-10 11:15:46 -0400 (Tue, 10 May 2011)
New Revision: 22481
Removed:
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/validation/groups/ValidableGroupNumericInputs.java
Modified:
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/rich/RichGraphValidatorBean.java
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/validation/groups/ValidationGroupNumericInputs.java
modules/tests/metamer/trunk/application/src/main/resources/org/richfaces/tests/metamer/bean/rich/RichGraphValidatorBean.properties
modules/tests/metamer/trunk/application/src/main/webapp/components/richGraphValidator/all.xhtml
Log:
Get groups attr in graphValidator working!
Modified: modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/rich/RichGraphValidatorBean.java
===================================================================
--- modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/rich/RichGraphValidatorBean.java 2011-05-09 21:11:13 UTC (rev 22480)
+++ modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/rich/RichGraphValidatorBean.java 2011-05-10 15:15:46 UTC (rev 22481)
@@ -33,10 +33,13 @@
import javax.faces.model.SelectItem;
import javax.validation.constraints.AssertTrue;
import javax.validation.constraints.NotNull;
+import javax.validation.groups.Default;
import org.hibernate.validator.constraints.NotEmpty;
import org.richfaces.component.UIGraphValidator;
+import org.richfaces.tests.metamer.Attribute;
import org.richfaces.tests.metamer.Attributes;
+import org.richfaces.tests.metamer.validation.groups.ValidationGroupAllComponents;
import org.richfaces.tests.metamer.validation.groups.ValidationGroupBooleanInputs;
import org.richfaces.tests.metamer.validation.groups.ValidationGroupNumericInputs;
import org.slf4j.Logger;
@@ -114,15 +117,17 @@
attributes.setAttribute("type", "org.richfaces.BeanValidator");
}
- @AssertTrue(message = "One of following inputs doesn't contain smile or numeric value 10!")
- public boolean isAllInputsCorrect(){
+ @AssertTrue(message = "One of following inputs doesn't contain smile or numeric value "
+ + REQUIRED_INT_VALUE + "!",
+ groups = {Default.class, ValidationGroupAllComponents.class})
+ public boolean isAllInputsCorrect() {
return autocompleteInput.contains(smile)
&& inplaceSelect.contains(smile)
&& inplaceInput.contains(smile)
&& select.contains(smile)
- && inputNumberSlider.equals(new Integer(10))
- && inputNumberSpinner.equals(new Integer(10))
+ && inputNumberSlider.equals(new Integer(REQUIRED_INT_VALUE))
+ && inputNumberSpinner.equals(new Integer(REQUIRED_INT_VALUE))
&& inputText.contains(smile)
&& inputSecret.contains(smile)
&& inputTextarea.contains(smile)
@@ -135,18 +140,18 @@
&& selectOneRadio.contains(smile);
}
- @AssertTrue(message = "One of following inputs doesn't contain smile",
+ @AssertTrue(message = "One of following numeric inputs doesn't contain value "
+ + REQUIRED_INT_VALUE + "!",
groups = {ValidationGroupNumericInputs.class})
public boolean isAllTextInputsCorrect() {
- return inputNumberSlider.equals(new Integer(10))
- && inputNumberSpinner.equals(new Integer(10));
+ return inputNumberSlider.equals(new Integer(REQUIRED_INT_VALUE))
+ && inputNumberSpinner.equals(new Integer(REQUIRED_INT_VALUE));
}
- @AssertTrue(message = "One of following inputs doesn't contain smile",
+ @AssertTrue(message = "Select Boolean Checkbox isn't checked!",
groups = {ValidationGroupBooleanInputs.class})
public boolean isAllBooleanInputsCorrect() {
- return inputNumberSlider.equals(new Integer(10))
- && inputNumberSpinner.equals(new Integer(10));
+ return selectBooleanCheckbox.booleanValue();
}
public void anotherActionOnAllComponents() {
@@ -165,8 +170,15 @@
return result;
}
- public Class<?> getValidationGroups() {
- return ValidationGroupNumericInputs.class;
+ public Class<?>[] getValidationGroups() throws ClassNotFoundException {
+ Attribute groups = attributes.get("groups");
+ Class<?> group;
+ if (groups.getValue() != null && !"".equals(groups.getValue())) {
+ group = Class.forName(groups.getValue().toString());
+ } else {
+ group = Default.class;
+ }
+ return new Class[]{group};
}
public Attributes getAttributes() {
Deleted: modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/validation/groups/ValidableGroupNumericInputs.java
===================================================================
--- modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/validation/groups/ValidableGroupNumericInputs.java 2011-05-09 21:11:13 UTC (rev 22480)
+++ modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/validation/groups/ValidableGroupNumericInputs.java 2011-05-10 15:15:46 UTC (rev 22481)
@@ -1,32 +0,0 @@
-/*******************************************************************************
- * 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.
- *******************************************************************************/
-package org.richfaces.tests.metamer.validation.groups;
-
-/**
- * Validation Group for Numeric Inputs
- *
- * @author <a href="mailto:jjamrich@redhat.com">Jan Jamrich</a>
- * @version $Revision$
- */
-public interface ValidableGroupNumericInputs {
-
-}
Modified: modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/validation/groups/ValidationGroupNumericInputs.java
===================================================================
--- modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/validation/groups/ValidationGroupNumericInputs.java 2011-05-09 21:11:13 UTC (rev 22480)
+++ modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/validation/groups/ValidationGroupNumericInputs.java 2011-05-10 15:15:46 UTC (rev 22481)
@@ -22,11 +22,11 @@
package org.richfaces.tests.metamer.validation.groups;
/**
- * Implementation test
+ * Validation Group for Numeric Inputs
*
* @author <a href="mailto:jjamrich@redhat.com">Jan Jamrich</a>
* @version $Revision$
*/
-public class ValidationGroupNumericInputs implements ValidableGroupNumericInputs {
+public interface ValidationGroupNumericInputs {
}
Modified: modules/tests/metamer/trunk/application/src/main/resources/org/richfaces/tests/metamer/bean/rich/RichGraphValidatorBean.properties
===================================================================
--- modules/tests/metamer/trunk/application/src/main/resources/org/richfaces/tests/metamer/bean/rich/RichGraphValidatorBean.properties 2011-05-09 21:11:13 UTC (rev 22480)
+++ modules/tests/metamer/trunk/application/src/main/resources/org/richfaces/tests/metamer/bean/rich/RichGraphValidatorBean.properties 2011-05-10 15:15:46 UTC (rev 22481)
@@ -1,2 +1,7 @@
attr.type.BeanValidator=org.richfaces.BeanValidator
+attr.groups.null=
+attr.groups.Default=javax.validation.groups.Default
+attr.groups.ValidationGroupAllComponents=org.richfaces.tests.metamer.validation.groups.ValidationGroupAllComponents
+attr.groups.ValidationGroupBooleanInputs=org.richfaces.tests.metamer.validation.groups.ValidationGroupBooleanInputs
+attr.groups.ValidationGroupNumericInputs=org.richfaces.tests.metamer.validation.groups.ValidationGroupNumericInputs
Modified: modules/tests/metamer/trunk/application/src/main/webapp/components/richGraphValidator/all.xhtml
===================================================================
--- modules/tests/metamer/trunk/application/src/main/webapp/components/richGraphValidator/all.xhtml 2011-05-09 21:11:13 UTC (rev 22480)
+++ modules/tests/metamer/trunk/application/src/main/webapp/components/richGraphValidator/all.xhtml 2011-05-10 15:15:46 UTC (rev 22481)
@@ -55,14 +55,16 @@
|| richGraphValidatorBean.attributes['summary'].value==''}" >
<rich:graphValidator id="gv1"
value="#{richGraphValidatorBean}"
- groups="#{richGraphValidatorBean.attributes['groups'].value}"
+ groups="#{richGraphValidatorBean.validationGroups}"
type="#{richGraphValidatorBean.attributes['type'].value}"
rendered="#{richGraphValidatorBean.attributes['rendered'].value}" >
<rich:panel header="Many rich components within rich:graphValidator" style="width:500px">
+ <rich:messages for="gv1" />
<rich:messages globalOnly="true" />
<h:panelGrid columns="3">
<h:outputText for="inplaceSelect" value="Inplace Select" />
- <rich:inplaceSelect id="inplaceSelect" value="#{richGraphValidatorBean.inplaceSelect}" >
+ <rich:inplaceSelect id="inplaceSelect" value="#{richGraphValidatorBean.inplaceSelect}"
+ defaultLabel="Write smile here..." >
<f:selectItems value="#{richGraphValidatorBean.selectItems}" />
</rich:inplaceSelect>
<rich:message for="inplaceSelect" />
13 years, 7 months
JBoss Rich Faces SVN: r22480 - in modules/tests/metamer/trunk/application/src: main/java/org/richfaces/tests/metamer/validation/groups and 2 other directories.
by richfaces-svn-commits@lists.jboss.org
Author: jjamrich
Date: 2011-05-09 17:11:13 -0400 (Mon, 09 May 2011)
New Revision: 22480
Added:
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/validation/groups/ValidableGroupNumericInputs.java
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/validation/groups/ValidationGroupAllComponents.java
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/validation/groups/ValidationGroupBooleanInputs.java
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/validation/groups/ValidationGroupNumericInputs.java
modules/tests/metamer/trunk/application/src/main/webapp/components/richGraphValidator/all.xhtml
Modified:
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/rich/RichGraphValidatorBean.java
modules/tests/metamer/trunk/application/src/main/webapp/components/richGraphValidator/list.xhtml
modules/tests/metamer/trunk/application/src/test/java/org/richfaces/tests/metamer/TestRichTreeModelRecursiveAdaptorBeanSerialization.java
Log:
Add some rich components into metamer within graphValidator
Add some components + new validation groups to test rich:graphValidator
behavior.
Modified: modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/rich/RichGraphValidatorBean.java
===================================================================
--- modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/rich/RichGraphValidatorBean.java 2011-05-06 18:27:42 UTC (rev 22479)
+++ modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/rich/RichGraphValidatorBean.java 2011-05-09 21:11:13 UTC (rev 22480)
@@ -22,20 +22,23 @@
package org.richfaces.tests.metamer.bean.rich;
import java.io.Serializable;
+import java.util.ArrayList;
+import java.util.List;
import javax.annotation.PostConstruct;
import javax.faces.application.FacesMessage;
import javax.faces.bean.ManagedBean;
import javax.faces.bean.ViewScoped;
import javax.faces.context.FacesContext;
+import javax.faces.model.SelectItem;
import javax.validation.constraints.AssertTrue;
-import javax.validation.constraints.Size;
-import javax.validation.groups.Default;
+import javax.validation.constraints.NotNull;
+import org.hibernate.validator.constraints.NotEmpty;
import org.richfaces.component.UIGraphValidator;
import org.richfaces.tests.metamer.Attributes;
-import org.richfaces.tests.metamer.validation.groups.ValidationGroup1;
-import org.richfaces.tests.metamer.validation.groups.ValidationGroup2;
+import org.richfaces.tests.metamer.validation.groups.ValidationGroupBooleanInputs;
+import org.richfaces.tests.metamer.validation.groups.ValidationGroupNumericInputs;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@@ -45,20 +48,62 @@
* @author <a href="mailto:jjamrich@redhat.com">Jan Jamrich</a>
* @version $Revision$
*/
-@ManagedBean(name="richGraphValidatorBean")
+@ManagedBean(name = "richGraphValidatorBean")
@ViewScoped
public class RichGraphValidatorBean implements Serializable, Cloneable {
+ /** Valid value of numeric inputs */
+ public static final int REQUIRED_INT_VALUE = 10;
+
/** Generated UID */
private static final long serialVersionUID = -960575870621302059L;
+
private static Logger logger;
+ private final String smile = ":-)";
private Attributes attributes;
- @Size(min = 5, max = 15, message = "Wrong size for password")
- private String password;
- @Size(min = 5, max = 15, message = "Wrong size for password")
- private String passwordConfirm;
+ private List<SelectItem> selectItems;
+ @NotNull
+ @NotEmpty
+ private String autocompleteInput = smile;
+ @NotNull
+ @NotEmpty
+ private String inplaceSelect = smile;
+ @NotNull
+ @NotEmpty
+ private String inplaceInput = smile;
+ @NotNull
+ @NotEmpty
+ private String select = smile;
+ private Integer inputNumberSlider = new Integer(REQUIRED_INT_VALUE);
+ private Integer inputNumberSpinner = new Integer(REQUIRED_INT_VALUE);
+ @NotNull
+ @NotEmpty
+ private String inputText = smile;
+ @NotNull
+ @NotEmpty
+ private String inputSecret = smile;
+ @NotNull
+ @NotEmpty
+ private String inputTextarea = smile;
+ private Boolean selectBooleanCheckbox = Boolean.TRUE;
+ @NotEmpty
+ private List<SelectItem> selectManyCheckbox = createSelectItems();
+ @NotNull
+ @NotEmpty
+ private String selectOneListbox = smile;
+ @NotEmpty
+ private List<SelectItem> selectManyListbox = createSelectItems();
+ @NotNull
+ @NotEmpty
+ private String selectOneMenu = smile;
+ @NotEmpty
+ private List<SelectItem> selectManyMenu = createSelectItems();
+ @NotNull
+ @NotEmpty
+ private String selectOneRadio = smile;
+
@PostConstruct
public void init(){
logger = LoggerFactory.getLogger(getClass());
@@ -69,25 +114,60 @@
attributes.setAttribute("type", "org.richfaces.BeanValidator");
}
- @AssertTrue(message = "Different passwords entered! [Default Group]")
- public boolean isPasswordsEquals() {
- return password.equals(passwordConfirm);
+ @AssertTrue(message = "One of following inputs doesn't contain smile or numeric value 10!")
+ public boolean isAllInputsCorrect(){
+
+ return autocompleteInput.contains(smile)
+ && inplaceSelect.contains(smile)
+ && inplaceInput.contains(smile)
+ && select.contains(smile)
+ && inputNumberSlider.equals(new Integer(10))
+ && inputNumberSpinner.equals(new Integer(10))
+ && inputText.contains(smile)
+ && inputSecret.contains(smile)
+ && inputTextarea.contains(smile)
+ && selectBooleanCheckbox.booleanValue()
+ && !selectManyCheckbox.isEmpty()
+ && selectOneListbox.contains(smile)
+ && !selectManyListbox.isEmpty()
+ && selectOneMenu.contains(smile)
+ && !selectManyMenu.isEmpty()
+ && selectOneRadio.contains(smile);
}
- @AssertTrue(message = "Different passwords entered! [G1]", groups={ValidationGroup1.class})
- public boolean isRovnakeHesla() {
- return password.equals(passwordConfirm);
+ @AssertTrue(message = "One of following inputs doesn't contain smile",
+ groups = {ValidationGroupNumericInputs.class})
+ public boolean isAllTextInputsCorrect() {
+ return inputNumberSlider.equals(new Integer(10))
+ && inputNumberSpinner.equals(new Integer(10));
}
- @AssertTrue(message = "Different passwords entered! [G2 + Default Group]", groups = {ValidationGroup2.class,Default.class})
- public boolean isPokusUspesny() {
- return password.equals(passwordConfirm);
+ @AssertTrue(message = "One of following inputs doesn't contain smile",
+ groups = {ValidationGroupBooleanInputs.class})
+ public boolean isAllBooleanInputsCorrect() {
+ return inputNumberSlider.equals(new Integer(10))
+ && inputNumberSpinner.equals(new Integer(10));
}
- public void storeNewPassword() {
+ public void anotherActionOnAllComponents() {
FacesContext.getCurrentInstance().addMessage(null,
- new FacesMessage(FacesMessage.SEVERITY_INFO, "Succesfully changed!", "Succesfully changed!"));
+ new FacesMessage(FacesMessage.SEVERITY_INFO, "Action sucessfully done!", "Action sucessfully done!"));
}
+
+ private List<SelectItem> createSelectItems() {
+ List<SelectItem> result = new ArrayList<SelectItem>();
+ result.add(new SelectItem("a", "Abcd"));
+ result.add(new SelectItem("b", "Bcde"));
+ result.add(new SelectItem("c", "Cdef"));
+ result.add(new SelectItem("d", "Defg"));
+ result.add(new SelectItem(smile, smile));
+
+ return result;
+ }
+
+ public Class<?> getValidationGroups() {
+ return ValidationGroupNumericInputs.class;
+ }
public Attributes getAttributes() {
return attributes;
@@ -97,19 +177,142 @@
this.attributes = attributes;
}
- public String getPassword() {
- return password;
+ public String getAutocompleteInput() {
+ return autocompleteInput;
}
- public void setPassword(String password) {
- this.password = password;
+ public void setAutocompleteInput(String autocompleteInput) {
+ this.autocompleteInput = autocompleteInput;
}
- public String getPasswordConfirm() {
- return passwordConfirm;
+ public String getInplaceSelect() {
+ return inplaceSelect;
}
- public void setPasswordConfirm(String passwordConfirm) {
- this.passwordConfirm = passwordConfirm;
+ public void setInplaceSelect(String inplaceSelect) {
+ this.inplaceSelect = inplaceSelect;
}
+
+ public String getInplaceInput() {
+ return inplaceInput;
+ }
+
+ public void setInplaceInput(String inplaceInput) {
+ this.inplaceInput = inplaceInput;
+ }
+
+ public String getSelect() {
+ return select;
+ }
+
+ public void setSelect(String select) {
+ this.select = select;
+ }
+
+ public List<SelectItem> getSelectItems() {
+ if (selectItems == null ) {
+ selectItems = createSelectItems();
+ }
+ return selectItems;
+ }
+
+ public void setSelectItems(List<SelectItem> selectItems) {
+ this.selectItems = selectItems;
+ }
+
+ public Integer getInputNumberSlider() {
+ return inputNumberSlider;
+ }
+
+ public void setInputNumberSlider(Integer inputNumberSlider) {
+ this.inputNumberSlider = inputNumberSlider;
+ }
+
+ public Integer getInputNumberSpinner() {
+ return inputNumberSpinner;
+ }
+
+ public void setInputNumberSpinner(Integer inputNumberSpinner) {
+ this.inputNumberSpinner = inputNumberSpinner;
+ }
+
+ public String getInputText() {
+ return inputText;
+ }
+
+ public void setInputText(String inputText) {
+ this.inputText = inputText;
+ }
+
+ public String getInputSecret() {
+ return inputSecret;
+ }
+
+ public void setInputSecret(String inputSecret) {
+ this.inputSecret = inputSecret;
+ }
+
+ public String getInputTextarea() {
+ return inputTextarea;
+ }
+
+ public void setInputTextarea(String inputTextarea) {
+ this.inputTextarea = inputTextarea;
+ }
+
+ public Boolean getSelectBooleanCheckbox() {
+ return selectBooleanCheckbox;
+ }
+
+ public void setSelectBooleanCheckbox(Boolean selectBooleanCheckbox) {
+ this.selectBooleanCheckbox = selectBooleanCheckbox;
+ }
+
+ public List<SelectItem> getSelectManyCheckbox() {
+ return selectManyCheckbox;
+ }
+
+ public void setSelectManyCheckbox(List<SelectItem> selectManyCheckbox) {
+ this.selectManyCheckbox = selectManyCheckbox;
+ }
+
+ public String getSelectOneListbox() {
+ return selectOneListbox;
+ }
+
+ public void setSelectOneListbox(String selectOneListbox) {
+ this.selectOneListbox = selectOneListbox;
+ }
+
+ public List<SelectItem> getSelectManyListbox() {
+ return selectManyListbox;
+ }
+
+ public void setSelectManyListbox(List<SelectItem> selectManyListbox) {
+ this.selectManyListbox = selectManyListbox;
+ }
+
+ public String getSelectOneMenu() {
+ return selectOneMenu;
+ }
+
+ public void setSelectOneMenu(String selectOneMenu) {
+ this.selectOneMenu = selectOneMenu;
+ }
+
+ public List<SelectItem> getSelectManyMenu() {
+ return selectManyMenu;
+ }
+
+ public void setSelectManyMenu(List<SelectItem> selectManyMenu) {
+ this.selectManyMenu = selectManyMenu;
+ }
+
+ public String getSelectOneRadio() {
+ return selectOneRadio;
+ }
+
+ public void setSelectOneRadio(String selectOneRadio) {
+ this.selectOneRadio = selectOneRadio;
+ }
}
Added: modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/validation/groups/ValidableGroupNumericInputs.java
===================================================================
--- modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/validation/groups/ValidableGroupNumericInputs.java (rev 0)
+++ modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/validation/groups/ValidableGroupNumericInputs.java 2011-05-09 21:11:13 UTC (rev 22480)
@@ -0,0 +1,32 @@
+/*******************************************************************************
+ * 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.
+ *******************************************************************************/
+package org.richfaces.tests.metamer.validation.groups;
+
+/**
+ * Validation Group for Numeric Inputs
+ *
+ * @author <a href="mailto:jjamrich@redhat.com">Jan Jamrich</a>
+ * @version $Revision$
+ */
+public interface ValidableGroupNumericInputs {
+
+}
Added: modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/validation/groups/ValidationGroupAllComponents.java
===================================================================
--- modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/validation/groups/ValidationGroupAllComponents.java (rev 0)
+++ modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/validation/groups/ValidationGroupAllComponents.java 2011-05-09 21:11:13 UTC (rev 22480)
@@ -0,0 +1,32 @@
+/*******************************************************************************
+ * 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.
+ *******************************************************************************/
+package org.richfaces.tests.metamer.validation.groups;
+
+/**
+ * Validation group for page with many rich components
+ *
+ * @author <a href="mailto:jjamrich@redhat.com">Jan Jamrich</a>
+ * @version $Revision$
+ */
+public interface ValidationGroupAllComponents {
+
+}
Added: modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/validation/groups/ValidationGroupBooleanInputs.java
===================================================================
--- modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/validation/groups/ValidationGroupBooleanInputs.java (rev 0)
+++ modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/validation/groups/ValidationGroupBooleanInputs.java 2011-05-09 21:11:13 UTC (rev 22480)
@@ -0,0 +1,32 @@
+/*******************************************************************************
+ * 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.
+ *******************************************************************************/
+package org.richfaces.tests.metamer.validation.groups;
+
+/**
+ * Validation Group for Boolean Inputs
+ *
+ * @author <a href="mailto:jjamrich@redhat.com">Jan Jamrich</a>
+ * @version $Revision$
+ */
+public interface ValidationGroupBooleanInputs {
+
+}
Added: modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/validation/groups/ValidationGroupNumericInputs.java
===================================================================
--- modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/validation/groups/ValidationGroupNumericInputs.java (rev 0)
+++ modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/validation/groups/ValidationGroupNumericInputs.java 2011-05-09 21:11:13 UTC (rev 22480)
@@ -0,0 +1,32 @@
+/*******************************************************************************
+ * 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.
+ *******************************************************************************/
+package org.richfaces.tests.metamer.validation.groups;
+
+/**
+ * Implementation test
+ *
+ * @author <a href="mailto:jjamrich@redhat.com">Jan Jamrich</a>
+ * @version $Revision$
+ */
+public class ValidationGroupNumericInputs implements ValidableGroupNumericInputs {
+
+}
Added: modules/tests/metamer/trunk/application/src/main/webapp/components/richGraphValidator/all.xhtml
===================================================================
--- modules/tests/metamer/trunk/application/src/main/webapp/components/richGraphValidator/all.xhtml (rev 0)
+++ modules/tests/metamer/trunk/application/src/main/webapp/components/richGraphValidator/all.xhtml 2011-05-09 21:11:13 UTC (rev 22480)
@@ -0,0 +1,185 @@
+<?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:rich="http://richfaces.org/rich"
+ xmlns:metamer="http://java.sun.com/jsf/composite/metamer">
+
+<!--
+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: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">
+ <style type="text/css">
+
+ </style>
+ </ui:define>
+
+ <ui:define name="component">
+ <script type="text/javascript">
+ </script>
+
+ <h:form>
+ <ui:fragment rendered="#{richGraphValidatorBean.attributes['summary'].value==null
+ || richGraphValidatorBean.attributes['summary'].value==''}" >
+ <rich:graphValidator id="gv1"
+ value="#{richGraphValidatorBean}"
+ groups="#{richGraphValidatorBean.attributes['groups'].value}"
+ type="#{richGraphValidatorBean.attributes['type'].value}"
+ rendered="#{richGraphValidatorBean.attributes['rendered'].value}" >
+ <rich:panel header="Many rich components within rich:graphValidator" style="width:500px">
+ <rich:messages globalOnly="true" />
+ <h:panelGrid columns="3">
+ <h:outputText for="inplaceSelect" value="Inplace Select" />
+ <rich:inplaceSelect id="inplaceSelect" value="#{richGraphValidatorBean.inplaceSelect}" >
+ <f:selectItems value="#{richGraphValidatorBean.selectItems}" />
+ </rich:inplaceSelect>
+ <rich:message for="inplaceSelect" />
+
+ <h:outputText for="inplaceInput" value="Inplace Input" />
+ <rich:inplaceInput id="inplaceInput" value="#{richGraphValidatorBean.inplaceInput}" />
+ <rich:message for="inplaceInput" />
+
+ <h:outputText for="select" value="Select" />
+ <rich:select id="select" value="#{richGraphValidatorBean.select}" >
+ <f:selectItems value="#{richGraphValidatorBean.selectItems}" />
+ </rich:select>
+ <rich:message for="select" />
+
+ <h:outputText for="inputNumberSlider" value="Input Number Slider" />
+ <rich:inputNumberSlider id="inputNumberSlider" value="#{richGraphValidatorBean.inputNumberSlider}" />
+ <rich:message for="inputNumberSlider" />
+
+ <h:outputText for="inputNumberSpinner" value="Input Number Spinner" />
+ <rich:inputNumberSpinner id="inputNumberSpinner" value="#{richGraphValidatorBean.inputNumberSpinner}" />
+ <rich:message for="inputNumberSpinner" />
+
+ <h:outputText for="autocomplete" value="Autocomplete" />
+ <rich:autocomplete id="autocomplete" value="#{richGraphValidatorBean.autocompleteInput}" />
+ <rich:message for="autocomplete" />
+
+ <h:outputText for="inputText" value="Input Text" />
+ <h:inputText id="inputText" value="#{richGraphValidatorBean.inputText}" />
+ <rich:message for="inputText" />
+
+ <h:outputText for="inputSecret" value="Input Secret" />
+ <h:inputSecret id="inputSecret" value="#{richGraphValidatorBean.inputSecret}" />
+ <rich:message for="inputSecret" />
+
+ <h:outputText for="inputTextarea" value="Input Text Area" />
+ <h:inputTextarea id="inputTextarea" value="#{richGraphValidatorBean.inputTextarea}" />
+ <rich:message for="inputTextarea" />
+
+ <h:outputText for="selectBooleanCheckbox" value="Select Boolean Checkbox" />
+ <h:selectBooleanCheckbox id="selectBooleanCheckbox" value="#{richGraphValidatorBean.selectBooleanCheckbox}" />
+ <rich:message for="selectBooleanCheckbox" />
+
+ <h:outputText for="selectManyCheckbox" value="Select Many Checkbox" />
+ <h:selectManyCheckbox id="selectManyCheckbox"
+ value="#{richGraphValidatorBean.selectManyCheckbox}" >
+ <f:selectItems value="#{richGraphValidatorBean.selectItems}" />
+ </h:selectManyCheckbox>
+ <rich:message for="selectManyCheckbox" />
+
+ <h:outputText for="selectOneListbox" value="Select One Listbox" />
+ <h:selectOneListbox id="selectOneListbox" value="#{richGraphValidatorBean.selectOneListbox}" >
+ <f:selectItems value="#{richGraphValidatorBean.selectItems}" />
+ </h:selectOneListbox>
+ <rich:message for="selectOneListbox" />
+
+ <h:outputText for="selectManyListbox" value="Select Many Listbox" />
+ <h:selectManyListbox id="selectManyListbox" value="#{richGraphValidatorBean.selectManyListbox}" >
+ <f:selectItems value="#{richGraphValidatorBean.selectItems}" />
+ </h:selectManyListbox>
+ <rich:message for="selectManyListbox" />
+
+ <h:outputText for="selectOneMenu" value="Select One Menu" />
+ <h:selectOneMenu id="selectOneMenu" value="#{richGraphValidatorBean.selectOneMenu}" >
+ <f:selectItems value="#{richGraphValidatorBean.selectItems}" />
+ </h:selectOneMenu>
+ <rich:message for="selectOneMenu" />
+
+ <h:outputText for="selectManyMenu" value="Select Many Menu" />
+ <h:selectManyMenu id="selectManyMenu" value="#{richGraphValidatorBean.selectManyMenu}" >
+ <f:selectItems value="#{richGraphValidatorBean.selectItems}" />
+ </h:selectManyMenu>
+ <rich:message for="selectManyMenu" />
+
+ <h:outputText for="selectOneRadio" value="Select One Radio" />
+ <h:selectOneRadio id="selectOneRadio" value="#{richGraphValidatorBean.selectOneRadio}" >
+ <f:selectItems value="#{richGraphValidatorBean.selectItems}" />
+ </h:selectOneRadio>
+ <rich:message for="selectOneRadio" />
+
+ </h:panelGrid>
+ <a4j:commandButton value="Apply changes"
+ action="#{richGraphValidatorBean.anotherActionOnAllComponents}" />
+ </rich:panel>
+ </rich:graphValidator>
+ </ui:fragment>
+
+ <ui:fragment rendered="#{richGraphValidatorBean.attributes['summary'].value!=null
+ && richGraphValidatorBean.attributes['summary'].value!=''}" >
+ <rich:graphValidator id="gv2"
+ value="#{richGraphValidatorBean}"
+ groups="#{richGraphValidatorBean.attributes['groups'].value}"
+ rendered="#{richGraphValidatorBean.attributes['rendered'].value}"
+ summary="#{richGraphValidatorBean.attributes['summary'].value}"
+ type="#{richGraphValidatorBean.attributes['type'].value}" >
+ <rich:panel header="Change password" style="width:500px">
+ <rich:messages for="gv2" />
+ <rich:messages globalOnly="true" />
+ <h:panelGrid columns="3">
+
+ </h:panelGrid>
+ <a4j:commandButton value="Store changes"
+ action="#{richGraphValidatorBean.anotherActionOnAllComponents}" />
+ </rich:panel>
+ </rich:graphValidator>
+ </ui:fragment>
+
+ </h:form>
+
+ <br />
+ <rich:messages id="msgs" value="#{richGraphValidatorBean}" />
+
+ </ui:define>
+
+ <ui:define name="outOfTemplateAfter">
+ <metamer:attributes value="#{richGraphValidatorBean.attributes}"
+ id="attributes" />
+ </ui:define>
+
+</ui:composition>
+</html>
\ No newline at end of file
Modified: modules/tests/metamer/trunk/application/src/main/webapp/components/richGraphValidator/list.xhtml
===================================================================
--- modules/tests/metamer/trunk/application/src/main/webapp/components/richGraphValidator/list.xhtml 2011-05-06 18:27:42 UTC (rev 22479)
+++ modules/tests/metamer/trunk/application/src/main/webapp/components/richGraphValidator/list.xhtml 2011-05-09 21:11:13 UTC (rev 22480)
@@ -31,8 +31,8 @@
<ui:define name="links">
- <metamer:testPageLink id="jsr303" outcome="jsr303" value="JSR-303 Bean Validation">
- Page containing input with JSR-303 validator within <b>rich:graphValidator</b>
+ <metamer:testPageLink id="all" outcome="all" value="Rich components within graphValidator">
+ Page containing many different rich components within <b>rich:graphValidator</b>
</metamer:testPageLink>
</ui:define>
Modified: modules/tests/metamer/trunk/application/src/test/java/org/richfaces/tests/metamer/TestRichTreeModelRecursiveAdaptorBeanSerialization.java
===================================================================
--- modules/tests/metamer/trunk/application/src/test/java/org/richfaces/tests/metamer/TestRichTreeModelRecursiveAdaptorBeanSerialization.java 2011-05-06 18:27:42 UTC (rev 22479)
+++ modules/tests/metamer/trunk/application/src/test/java/org/richfaces/tests/metamer/TestRichTreeModelRecursiveAdaptorBeanSerialization.java 2011-05-09 21:11:13 UTC (rev 22480)
@@ -51,10 +51,10 @@
*/
public class TestRichTreeModelRecursiveAdaptorBeanSerialization {
+ PrintStream sysout;
+
private Set<Integer> notEquals = new TreeSet<Integer>();
- PrintStream sysout;
-
@BeforeClass
public void redirectOut() {
sysout = System.out;
13 years, 7 months
JBoss Rich Faces SVN: r22479 - in modules/tests/metamer/trunk: application/src/main/webapp/components/richMessage and 3 other directories.
by richfaces-svn-commits@lists.jboss.org
Author: ppitonak(a)redhat.com
Date: 2011-05-06 14:27:42 -0400 (Fri, 06 May 2011)
New Revision: 22479
Modified:
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/rich/RichMessageBean.java
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/rich/RichMessagesBean.java
modules/tests/metamer/trunk/application/src/main/webapp/components/richMessage/csv.xhtml
modules/tests/metamer/trunk/application/src/main/webapp/components/richMessage/jsfValidator.xhtml
modules/tests/metamer/trunk/application/src/main/webapp/components/richMessage/jsr303.xhtml
modules/tests/metamer/trunk/application/src/main/webapp/components/richMessage/list.xhtml
modules/tests/metamer/trunk/application/src/main/webapp/components/richMessages/csv.xhtml
modules/tests/metamer/trunk/application/src/main/webapp/components/richMessages/jsfValidator.xhtml
modules/tests/metamer/trunk/application/src/main/webapp/components/richMessages/jsr303.xhtml
modules/tests/metamer/trunk/application/src/main/webapp/components/richMessages/list.xhtml
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richMessage/AbstractRichMessageTest.java
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richMessage/RichMessageAttributes.java
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richMessage/RichMessageComponentAttributes.java
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richMessage/RichMessageTest.java
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richMessage/TestRichMessageCSV.java
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richMessage/TestRichMessageJSFValidator.java
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richMessage/TestRichMessageJSR303.java
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richMessages/RichMessagesTest.java
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richMessages/TestRichMessagesCSV.java
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richMessages/TestRichMessagesJSFValidator.java
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richMessages/TestRichMessagesJSR303.java
Log:
samples and tests for rich:message and rich:messages cleaned, code formatted
Modified: modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/rich/RichMessageBean.java
===================================================================
--- modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/rich/RichMessageBean.java 2011-05-06 18:23:48 UTC (rev 22478)
+++ modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/rich/RichMessageBean.java 2011-05-06 18:27:42 UTC (rev 22479)
@@ -54,11 +54,11 @@
logger = LoggerFactory.getLogger(getClass());
logger.info("initializing bean " + getClass().getName());
attributes = Attributes.getComponentAttributesFromFacesConfig(UIRichMessage.class, getClass());
-
+
// setting up incorrect values to fire-up validator
simpleInput1 = "-5";
simpleInput2 = "-5";
-
+
// to get working this component example correctly is required that for
// property has been initialized
attributes.setAttribute("for", "simpleInput1");
Modified: modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/rich/RichMessagesBean.java
===================================================================
--- modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/rich/RichMessagesBean.java 2011-05-06 18:23:48 UTC (rev 22478)
+++ modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/rich/RichMessagesBean.java 2011-05-06 18:27:42 UTC (rev 22479)
@@ -44,82 +44,80 @@
@ManagedBean(name = "richMessagesBean")
@ViewScoped
public class RichMessagesBean implements Serializable {
-
+
/** Generated UID */
private static final long serialVersionUID = 4893769498631480379L;
// id for input element to bound some FacesMessage to it
private static final String INPUT1_ID = "form:simpleInput1";
private static final String INPUT2_ID = "form:simpleInput2";
-
private static Logger logger;
private Attributes attributes;
-
private String simpleInput1;
private String simpleInput2;
-
+
@PostConstruct
public void init() {
logger = LoggerFactory.getLogger(getClass());
logger.info("initializing bean " + getClass().getName());
attributes = Attributes.getComponentAttributesFromFacesConfig(UIRichMessages.class, getClass());
-
+
simpleInput1 = "10";
simpleInput2 = "10";
-
+
attributes.setAttribute("ajaxRendered", true);
attributes.setAttribute("rendered", true);
attributes.setAttribute("for", "simpleInput1");
attributes.setAttribute("showSummary", true);
-
+
// add attributes with missing appropriate annotation
attributes.setAttribute("lang", null);
attributes.setAttribute("dir", null);
attributes.setAttribute("style", null);
attributes.setAttribute("styleClass", null);
attributes.setAttribute("title", null);
-
+
attributes.setAttribute("onclick", null);
attributes.setAttribute("ondblclick", null);
attributes.setAttribute("onkeydown", null);
attributes.setAttribute("onkeypress", null);
- attributes.setAttribute("onkeyup", null);
+ attributes.setAttribute("onkeyup", null);
attributes.setAttribute("onmousedown", null);
- attributes.setAttribute("onmousemove", null);
+ attributes.setAttribute("onmousemove", null);
attributes.setAttribute("onmouseup", null);
attributes.setAttribute("onmouseout", null);
attributes.setAttribute("onmouseover", null);
-
+
}
-
+
public void generateFacesError(ActionEvent event) {
-
+
logger.info(" ### Just called generateFacesError()");
- FacesContext.getCurrentInstance().addMessage(null,
- new FacesMessage(FacesMessage.SEVERITY_ERROR,
- "Generated error message without binding to any component (global)",
+ FacesContext.getCurrentInstance().addMessage(null,
+ new FacesMessage(FacesMessage.SEVERITY_ERROR,
+ "Generated error message without binding to any component (global)",
"Generated error message without binding to any component (global)"));
-
- FacesContext.getCurrentInstance().addMessage(null,
- new FacesMessage(FacesMessage.SEVERITY_WARN,
- "Generated warning message without binding to any component (global)",
+
+ FacesContext.getCurrentInstance().addMessage(null,
+ new FacesMessage(FacesMessage.SEVERITY_WARN,
+ "Generated warning message without binding to any component (global)",
"Generated warning message without binding to any component (global)"));
-
+
// Message bound to component on page
- FacesContext.getCurrentInstance().addMessage(INPUT1_ID,
- new FacesMessage(FacesMessage.SEVERITY_ERROR, "Generated error message for Input 1",
+ FacesContext.getCurrentInstance().addMessage(INPUT1_ID,
+ new FacesMessage(FacesMessage.SEVERITY_ERROR, "Generated error message for Input 1",
"Generated error message for Input 1"));
-
- FacesContext.getCurrentInstance().addMessage(INPUT1_ID,
- new FacesMessage(FacesMessage.SEVERITY_WARN, "Generated warning message for Input 1",
+
+ FacesContext.getCurrentInstance().addMessage(INPUT1_ID,
+ new FacesMessage(FacesMessage.SEVERITY_WARN, "Generated warning message for Input 1",
"Generated warning message for Input 1"));
-
- FacesContext.getCurrentInstance().addMessage(INPUT2_ID,
- new FacesMessage(FacesMessage.SEVERITY_ERROR, "Generated error message for Input 2",
+
+ FacesContext.getCurrentInstance().addMessage(INPUT2_ID,
+ new FacesMessage(FacesMessage.SEVERITY_ERROR, "Generated error message for Input 2",
"Generated error message for Input 2"));
-
- FacesContext.getCurrentInstance().addMessage(INPUT2_ID,
- new FacesMessage(FacesMessage.SEVERITY_WARN, "Generated warning message for Input 2",
+
+ FacesContext.getCurrentInstance().addMessage(INPUT2_ID,
+ new FacesMessage(FacesMessage.SEVERITY_WARN, "Generated warning message for Input 2",
"Generated warning message for Input 2"));
}
@@ -146,5 +144,4 @@
public void setSimpleInput2(String simpleInput2) {
this.simpleInput2 = simpleInput2;
}
-
}
Modified: modules/tests/metamer/trunk/application/src/main/webapp/components/richMessage/csv.xhtml
===================================================================
--- modules/tests/metamer/trunk/application/src/main/webapp/components/richMessage/csv.xhtml 2011-05-06 18:23:48 UTC (rev 22478)
+++ modules/tests/metamer/trunk/application/src/main/webapp/components/richMessage/csv.xhtml 2011-05-06 18:27:42 UTC (rev 22479)
@@ -48,99 +48,99 @@
<ui:define name="component">
<script type="text/javascript">
function setCorrectValues() {
- $('input[id$=simpleInput1]').val('4');
- $('input[id$=simpleInput2]').val('4');
+ $('input[id$=simpleInput1]').val('4');
+ $('input[id$=simpleInput2]').val('4');
}
function setWrongValues() {
- $('input[id$=simpleInput1]').val('-5');
- $('input[id$=simpleInput2]').val('-5');
+ $('input[id$=simpleInput1]').val('-5');
+ $('input[id$=simpleInput2]').val('-5');
}
</script>
<input id="setCorrectValuesButton" type="button" value="set correct values" onclick="setCorrectValues()"/>
<input id="setWrongValuesButton" type="button" value="set wrong values" onclick="setWrongValues()"/>
-
+
<rich:message id="simpleInputMsg"
- ajaxRendered="#{richMessageBean.attributes['ajaxRendered'].value}"
- for="#{richMessageBean.attributes['for'].value}"
- keepTransient="#{richMessageBean.attributes['keepTransient'].value}"
- rendered="#{richMessageBean.attributes['rendered'].value}"
- showDetail="#{richMessageBean.attributes['showDetail'].value}"
- showSummary="#{richMessageBean.attributes['showSummary'].value}"
- dir="#{richMessageBean.attributes['dir'].value}"
- lang="#{richMessageBean.attributes['lang'].value}"
- onclick="#{richMessageBean.attributes['onclick'].value}"
- ondblclick="#{richMessageBean.attributes['ondblclick'].value}"
- onkeyup="#{richMessageBean.attributes['onkeyup'].value}"
- onkeydown="#{richMessageBean.attributes['onkeydown'].value}"
- onkeypress="#{richMessageBean.attributes['onkeypress'].value}"
- onmousedown="#{richMessageBean.attributes['onmousedown'].value}"
- onmousemove="#{richMessageBean.attributes['onmousemove'].value}"
- onmouseout="#{richMessageBean.attributes['onmouseout'].value}"
- onmouseover="#{richMessageBean.attributes['onmouseover'].value}"
- onmouseup="#{richMessageBean.attributes['onmouseup'].value}"
- style="#{richMessageBean.attributes['style'].value}"
- styleClass="#{richMessageBean.attributes['styleClass'].value}"
- title="#{richMessageBean.attributes['title'].value}"
- />
+ ajaxRendered="#{richMessageBean.attributes['ajaxRendered'].value}"
+ for="#{richMessageBean.attributes['for'].value}"
+ keepTransient="#{richMessageBean.attributes['keepTransient'].value}"
+ rendered="#{richMessageBean.attributes['rendered'].value}"
+ showDetail="#{richMessageBean.attributes['showDetail'].value}"
+ showSummary="#{richMessageBean.attributes['showSummary'].value}"
+ dir="#{richMessageBean.attributes['dir'].value}"
+ lang="#{richMessageBean.attributes['lang'].value}"
+ onclick="#{richMessageBean.attributes['onclick'].value}"
+ ondblclick="#{richMessageBean.attributes['ondblclick'].value}"
+ onkeyup="#{richMessageBean.attributes['onkeyup'].value}"
+ onkeydown="#{richMessageBean.attributes['onkeydown'].value}"
+ onkeypress="#{richMessageBean.attributes['onkeypress'].value}"
+ onmousedown="#{richMessageBean.attributes['onmousedown'].value}"
+ onmousemove="#{richMessageBean.attributes['onmousemove'].value}"
+ onmouseout="#{richMessageBean.attributes['onmouseout'].value}"
+ onmouseover="#{richMessageBean.attributes['onmouseover'].value}"
+ onmouseup="#{richMessageBean.attributes['onmouseup'].value}"
+ style="#{richMessageBean.attributes['style'].value}"
+ styleClass="#{richMessageBean.attributes['styleClass'].value}"
+ title="#{richMessageBean.attributes['title'].value}"
+ />
<h:panelGrid columns="3">
- <h:outputLabel for="simpleInput1" value="#{minMaxBean.description}" />
+ <h:outputLabel for="simpleInput1" value="#{minMaxBean.description}" />
<h:inputText id="simpleInput1" value="#{minMaxBean.value}" label="Input 1" converter="#{minMaxBean.converter}">
- <rich:validator />
- </h:inputText>
+ <rich:validator />
+ </h:inputText>
<rich:message id="simpleInputMsg1"
- ajaxRendered="#{richMessageBean.attributes['ajaxRendered'].value}"
- for="simpleInput1"
- keepTransient="#{richMessageBean.attributes['keepTransient'].value}"
- rendered="#{richMessageBean.attributes['rendered'].value}"
- showDetail="#{richMessageBean.attributes['showDetail'].value}"
- showSummary="#{richMessageBean.attributes['showSummary'].value}"
- dir="#{richMessageBean.attributes['dir'].value}"
- lang="#{richMessageBean.attributes['lang'].value}"
- onclick="#{richMessageBean.attributes['onclick'].value}"
- ondblclick="#{richMessageBean.attributes['ondblclick'].value}"
- onkeyup="#{richMessageBean.attributes['onkeyup'].value}"
- onkeydown="#{richMessageBean.attributes['onkeydown'].value}"
- onkeypress="#{richMessageBean.attributes['onkeypress'].value}"
- onmousedown="#{richMessageBean.attributes['onmousedown'].value}"
- onmousemove="#{richMessageBean.attributes['onmousemove'].value}"
- onmouseout="#{richMessageBean.attributes['onmouseout'].value}"
- onmouseover="#{richMessageBean.attributes['onmouseover'].value}"
- onmouseup="#{richMessageBean.attributes['onmouseup'].value}"
- style="#{richMessageBean.attributes['style'].value}"
- styleClass="#{richMessageBean.attributes['styleClass'].value}"
- title="#{richMessageBean.attributes['title'].value}"
- />
-
+ ajaxRendered="#{richMessageBean.attributes['ajaxRendered'].value}"
+ for="simpleInput1"
+ keepTransient="#{richMessageBean.attributes['keepTransient'].value}"
+ rendered="#{richMessageBean.attributes['rendered'].value}"
+ showDetail="#{richMessageBean.attributes['showDetail'].value}"
+ showSummary="#{richMessageBean.attributes['showSummary'].value}"
+ dir="#{richMessageBean.attributes['dir'].value}"
+ lang="#{richMessageBean.attributes['lang'].value}"
+ onclick="#{richMessageBean.attributes['onclick'].value}"
+ ondblclick="#{richMessageBean.attributes['ondblclick'].value}"
+ onkeyup="#{richMessageBean.attributes['onkeyup'].value}"
+ onkeydown="#{richMessageBean.attributes['onkeydown'].value}"
+ onkeypress="#{richMessageBean.attributes['onkeypress'].value}"
+ onmousedown="#{richMessageBean.attributes['onmousedown'].value}"
+ onmousemove="#{richMessageBean.attributes['onmousemove'].value}"
+ onmouseout="#{richMessageBean.attributes['onmouseout'].value}"
+ onmouseover="#{richMessageBean.attributes['onmouseover'].value}"
+ onmouseup="#{richMessageBean.attributes['onmouseup'].value}"
+ style="#{richMessageBean.attributes['style'].value}"
+ styleClass="#{richMessageBean.attributes['styleClass'].value}"
+ title="#{richMessageBean.attributes['title'].value}"
+ />
+
<h:outputLabel for="simpleInput2" value="#{minMaxBean.description}" />
<h:inputText id="simpleInput2" value="#{minMaxBean.value}" label="Input 2" converter="#{minMaxBean.converter}">
- <rich:validator />
+ <rich:validator />
</h:inputText>
<rich:message id="simpleInputMsg2"
- ajaxRendered="#{richMessageBean.attributes['ajaxRendered'].value}"
- for="simpleInput2"
- keepTransient="#{richMessageBean.attributes['keepTransient'].value}"
- rendered="#{richMessageBean.attributes['rendered'].value}"
- showDetail="#{richMessageBean.attributes['showDetail'].value}"
- showSummary="#{richMessageBean.attributes['showSummary'].value}"
- dir="#{richMessageBean.attributes['dir'].value}"
- lang="#{richMessageBean.attributes['lang'].value}"
- onclick="#{richMessageBean.attributes['onclick'].value}"
- ondblclick="#{richMessageBean.attributes['ondblclick'].value}"
- onkeyup="#{richMessageBean.attributes['onkeyup'].value}"
- onkeydown="#{richMessageBean.attributes['onkeydown'].value}"
- onkeypress="#{richMessageBean.attributes['onkeypress'].value}"
- onmousedown="#{richMessageBean.attributes['onmousedown'].value}"
- onmousemove="#{richMessageBean.attributes['onmousemove'].value}"
- onmouseout="#{richMessageBean.attributes['onmouseout'].value}"
- onmouseover="#{richMessageBean.attributes['onmouseover'].value}"
- onmouseup="#{richMessageBean.attributes['onmouseup'].value}"
- style="#{richMessageBean.attributes['style'].value}"
- styleClass="#{richMessageBean.attributes['styleClass'].value}"
- title="#{richMessageBean.attributes['title'].value}"
- />
-
+ ajaxRendered="#{richMessageBean.attributes['ajaxRendered'].value}"
+ for="simpleInput2"
+ keepTransient="#{richMessageBean.attributes['keepTransient'].value}"
+ rendered="#{richMessageBean.attributes['rendered'].value}"
+ showDetail="#{richMessageBean.attributes['showDetail'].value}"
+ showSummary="#{richMessageBean.attributes['showSummary'].value}"
+ dir="#{richMessageBean.attributes['dir'].value}"
+ lang="#{richMessageBean.attributes['lang'].value}"
+ onclick="#{richMessageBean.attributes['onclick'].value}"
+ ondblclick="#{richMessageBean.attributes['ondblclick'].value}"
+ onkeyup="#{richMessageBean.attributes['onkeyup'].value}"
+ onkeydown="#{richMessageBean.attributes['onkeydown'].value}"
+ onkeypress="#{richMessageBean.attributes['onkeypress'].value}"
+ onmousedown="#{richMessageBean.attributes['onmousedown'].value}"
+ onmousemove="#{richMessageBean.attributes['onmousemove'].value}"
+ onmouseout="#{richMessageBean.attributes['onmouseout'].value}"
+ onmouseover="#{richMessageBean.attributes['onmouseover'].value}"
+ onmouseup="#{richMessageBean.attributes['onmouseup'].value}"
+ style="#{richMessageBean.attributes['style'].value}"
+ styleClass="#{richMessageBean.attributes['styleClass'].value}"
+ title="#{richMessageBean.attributes['title'].value}"
+ />
+
</h:panelGrid>
<br/>
Modified: modules/tests/metamer/trunk/application/src/main/webapp/components/richMessage/jsfValidator.xhtml
===================================================================
--- modules/tests/metamer/trunk/application/src/main/webapp/components/richMessage/jsfValidator.xhtml 2011-05-06 18:23:48 UTC (rev 22478)
+++ modules/tests/metamer/trunk/application/src/main/webapp/components/richMessage/jsfValidator.xhtml 2011-05-06 18:27:42 UTC (rev 22479)
@@ -39,112 +39,112 @@
</f:viewParam>
</f:metadata>
</ui:define>
-
+
<ui:define name="component">
- <script type="text/javascript">
- function setCorrectValues() {
- $('input[id$=simpleInput1]').val('4');
- $('input[id$=simpleInput2]').val('4');
- }
+ <script type="text/javascript">
+ function setCorrectValues() {
+ $('input[id$=simpleInput1]').val('4');
+ $('input[id$=simpleInput2]').val('4');
+ }
- function setWrongValues() {
- $('input[id$=simpleInput1]').val('-5');
- $('input[id$=simpleInput2]').val('-5');
- }
+ function setWrongValues() {
+ $('input[id$=simpleInput1]').val('-5');
+ $('input[id$=simpleInput2]').val('-5');
+ }
</script>
<input id="setCorrectValuesButton" type="button" value="set correct values" onclick="setCorrectValues()"/>
<input id="setWrongValuesButton" type="button" value="set wrong values" onclick="setWrongValues()"/>
-
+
<rich:message id="simpleInputMsg"
- ajaxRendered="#{richMessageBean.attributes['ajaxRendered'].value}"
- for="#{richMessageBean.attributes['for'].value}"
- keepTransient="#{richMessageBean.attributes['keepTransient'].value}"
- rendered="#{richMessageBean.attributes['rendered'].value}"
- showDetail="#{richMessageBean.attributes['showDetail'].value}"
- showSummary="#{richMessageBean.attributes['showSummary'].value}"
- dir="#{richMessageBean.attributes['dir'].value}"
- lang="#{richMessageBean.attributes['lang'].value}"
- onclick="#{richMessageBean.attributes['onclick'].value}"
- ondblclick="#{richMessageBean.attributes['ondblclick'].value}"
- onkeyup="#{richMessageBean.attributes['onkeyup'].value}"
- onkeydown="#{richMessageBean.attributes['onkeydown'].value}"
- onkeypress="#{richMessageBean.attributes['onkeypress'].value}"
- onmousedown="#{richMessageBean.attributes['onmousedown'].value}"
- onmousemove="#{richMessageBean.attributes['onmousemove'].value}"
- onmouseout="#{richMessageBean.attributes['onmouseout'].value}"
- onmouseover="#{richMessageBean.attributes['onmouseover'].value}"
- onmouseup="#{richMessageBean.attributes['onmouseup'].value}"
- style="#{richMessageBean.attributes['style'].value}"
- styleClass="#{richMessageBean.attributes['styleClass'].value}"
- title="#{richMessageBean.attributes['title'].value}"
- />
-
+ ajaxRendered="#{richMessageBean.attributes['ajaxRendered'].value}"
+ for="#{richMessageBean.attributes['for'].value}"
+ keepTransient="#{richMessageBean.attributes['keepTransient'].value}"
+ rendered="#{richMessageBean.attributes['rendered'].value}"
+ showDetail="#{richMessageBean.attributes['showDetail'].value}"
+ showSummary="#{richMessageBean.attributes['showSummary'].value}"
+ dir="#{richMessageBean.attributes['dir'].value}"
+ lang="#{richMessageBean.attributes['lang'].value}"
+ onclick="#{richMessageBean.attributes['onclick'].value}"
+ ondblclick="#{richMessageBean.attributes['ondblclick'].value}"
+ onkeyup="#{richMessageBean.attributes['onkeyup'].value}"
+ onkeydown="#{richMessageBean.attributes['onkeydown'].value}"
+ onkeypress="#{richMessageBean.attributes['onkeypress'].value}"
+ onmousedown="#{richMessageBean.attributes['onmousedown'].value}"
+ onmousemove="#{richMessageBean.attributes['onmousemove'].value}"
+ onmouseout="#{richMessageBean.attributes['onmouseout'].value}"
+ onmouseover="#{richMessageBean.attributes['onmouseover'].value}"
+ onmouseup="#{richMessageBean.attributes['onmouseup'].value}"
+ style="#{richMessageBean.attributes['style'].value}"
+ styleClass="#{richMessageBean.attributes['styleClass'].value}"
+ title="#{richMessageBean.attributes['title'].value}"
+ />
+
<h:panelGrid columns="3">
- <h:outputLabel for="simpleInput1" value="#{minMaxBean.description}" />
+ <h:outputLabel for="simpleInput1" value="#{minMaxBean.description}" />
<h:inputText id="simpleInput1" value="#{richMessageBean.simpleInput1}" label="Input 1" >
- <f:validateLongRange minimum="2" maximum="10" />
+ <f:validateLongRange minimum="2" maximum="10" />
</h:inputText>
<rich:message id="simpleInputMsg1"
- ajaxRendered="#{richMessageBean.attributes['ajaxRendered'].value}"
- for="simpleInput1"
- keepTransient="#{richMessageBean.attributes['keepTransient'].value}"
- rendered="#{richMessageBean.attributes['rendered'].value}"
- showDetail="#{richMessageBean.attributes['showDetail'].value}"
- showSummary="#{richMessageBean.attributes['showSummary'].value}"
- dir="#{richMessageBean.attributes['dir'].value}"
- lang="#{richMessageBean.attributes['lang'].value}"
- onclick="#{richMessageBean.attributes['onclick'].value}"
- ondblclick="#{richMessageBean.attributes['ondblclick'].value}"
- onkeyup="#{richMessageBean.attributes['onkeyup'].value}"
- onkeydown="#{richMessageBean.attributes['onkeydown'].value}"
- onkeypress="#{richMessageBean.attributes['onkeypress'].value}"
- onmousedown="#{richMessageBean.attributes['onmousedown'].value}"
- onmousemove="#{richMessageBean.attributes['onmousemove'].value}"
- onmouseout="#{richMessageBean.attributes['onmouseout'].value}"
- onmouseover="#{richMessageBean.attributes['onmouseover'].value}"
- onmouseup="#{richMessageBean.attributes['onmouseup'].value}"
- style="#{richMessageBean.attributes['style'].value}"
- styleClass="#{richMessageBean.attributes['styleClass'].value}"
- title="#{richMessageBean.attributes['title'].value}"
- />
+ ajaxRendered="#{richMessageBean.attributes['ajaxRendered'].value}"
+ for="simpleInput1"
+ keepTransient="#{richMessageBean.attributes['keepTransient'].value}"
+ rendered="#{richMessageBean.attributes['rendered'].value}"
+ showDetail="#{richMessageBean.attributes['showDetail'].value}"
+ showSummary="#{richMessageBean.attributes['showSummary'].value}"
+ dir="#{richMessageBean.attributes['dir'].value}"
+ lang="#{richMessageBean.attributes['lang'].value}"
+ onclick="#{richMessageBean.attributes['onclick'].value}"
+ ondblclick="#{richMessageBean.attributes['ondblclick'].value}"
+ onkeyup="#{richMessageBean.attributes['onkeyup'].value}"
+ onkeydown="#{richMessageBean.attributes['onkeydown'].value}"
+ onkeypress="#{richMessageBean.attributes['onkeypress'].value}"
+ onmousedown="#{richMessageBean.attributes['onmousedown'].value}"
+ onmousemove="#{richMessageBean.attributes['onmousemove'].value}"
+ onmouseout="#{richMessageBean.attributes['onmouseout'].value}"
+ onmouseover="#{richMessageBean.attributes['onmouseover'].value}"
+ onmouseup="#{richMessageBean.attributes['onmouseup'].value}"
+ style="#{richMessageBean.attributes['style'].value}"
+ styleClass="#{richMessageBean.attributes['styleClass'].value}"
+ title="#{richMessageBean.attributes['title'].value}"
+ />
</h:panelGrid>
-
+
<h:panelGrid columns="3">
- <h:outputLabel for="simpleInput2" value="#{minMaxBean.description}" />
+ <h:outputLabel for="simpleInput2" value="#{minMaxBean.description}" />
<h:inputText id="simpleInput2" value="#{richMessageBean.simpleInput2}" label="Input 2" >
- <f:validateLongRange minimum="2" maximum="10" />
+ <f:validateLongRange minimum="2" maximum="10" />
</h:inputText>
<rich:message id="simpleInputMsg2"
- ajaxRendered="#{richMessageBean.attributes['ajaxRendered'].value}"
- for="simpleInput2"
- keepTransient="#{richMessageBean.attributes['keepTransient'].value}"
- rendered="#{richMessageBean.attributes['rendered'].value}"
- showDetail="#{richMessageBean.attributes['showDetail'].value}"
- showSummary="#{richMessageBean.attributes['showSummary'].value}"
- dir="#{richMessageBean.attributes['dir'].value}"
- lang="#{richMessageBean.attributes['lang'].value}"
- onclick="#{richMessageBean.attributes['onclick'].value}"
- ondblclick="#{richMessageBean.attributes['ondblclick'].value}"
- onkeyup="#{richMessageBean.attributes['onkeyup'].value}"
- onkeydown="#{richMessageBean.attributes['onkeydown'].value}"
- onkeypress="#{richMessageBean.attributes['onkeypress'].value}"
- onmousedown="#{richMessageBean.attributes['onmousedown'].value}"
- onmousemove="#{richMessageBean.attributes['onmousemove'].value}"
- onmouseout="#{richMessageBean.attributes['onmouseout'].value}"
- onmouseover="#{richMessageBean.attributes['onmouseover'].value}"
- onmouseup="#{richMessageBean.attributes['onmouseup'].value}"
- style="#{richMessageBean.attributes['style'].value}"
- styleClass="#{richMessageBean.attributes['styleClass'].value}"
- title="#{richMessageBean.attributes['title'].value}"
- />
+ ajaxRendered="#{richMessageBean.attributes['ajaxRendered'].value}"
+ for="simpleInput2"
+ keepTransient="#{richMessageBean.attributes['keepTransient'].value}"
+ rendered="#{richMessageBean.attributes['rendered'].value}"
+ showDetail="#{richMessageBean.attributes['showDetail'].value}"
+ showSummary="#{richMessageBean.attributes['showSummary'].value}"
+ dir="#{richMessageBean.attributes['dir'].value}"
+ lang="#{richMessageBean.attributes['lang'].value}"
+ onclick="#{richMessageBean.attributes['onclick'].value}"
+ ondblclick="#{richMessageBean.attributes['ondblclick'].value}"
+ onkeyup="#{richMessageBean.attributes['onkeyup'].value}"
+ onkeydown="#{richMessageBean.attributes['onkeydown'].value}"
+ onkeypress="#{richMessageBean.attributes['onkeypress'].value}"
+ onmousedown="#{richMessageBean.attributes['onmousedown'].value}"
+ onmousemove="#{richMessageBean.attributes['onmousemove'].value}"
+ onmouseout="#{richMessageBean.attributes['onmouseout'].value}"
+ onmouseover="#{richMessageBean.attributes['onmouseover'].value}"
+ onmouseup="#{richMessageBean.attributes['onmouseup'].value}"
+ style="#{richMessageBean.attributes['style'].value}"
+ styleClass="#{richMessageBean.attributes['styleClass'].value}"
+ title="#{richMessageBean.attributes['title'].value}"
+ />
</h:panelGrid>
-
+
<br/>
-
+
<h:commandButton id="hButton" value="h:commandButton" style="margin-right: 10px;"/>
<a4j:commandButton id="a4jButton" value="a4j:commandButton"/>
-
+
<br/>
<rich:messages id="msgs"/>
</ui:define>
Modified: modules/tests/metamer/trunk/application/src/main/webapp/components/richMessage/jsr303.xhtml
===================================================================
--- modules/tests/metamer/trunk/application/src/main/webapp/components/richMessage/jsr303.xhtml 2011-05-06 18:23:48 UTC (rev 22478)
+++ modules/tests/metamer/trunk/application/src/main/webapp/components/richMessage/jsr303.xhtml 2011-05-06 18:27:42 UTC (rev 22479)
@@ -48,94 +48,94 @@
<ui:define name="component">
<script type="text/javascript">
function setCorrectValues() {
- $('input[id$=simpleInput1]').val('4');
- $('input[id$=simpleInput2]').val('4');
+ $('input[id$=simpleInput1]').val('4');
+ $('input[id$=simpleInput2]').val('4');
}
function setWrongValues() {
- $('input[id$=simpleInput1]').val('-5');
- $('input[id$=simpleInput2]').val('-5');
+ $('input[id$=simpleInput1]').val('-5');
+ $('input[id$=simpleInput2]').val('-5');
}
</script>
<input id="setCorrectValuesButton" type="button" value="set correct values" onclick="setCorrectValues()"/>
<input id="setWrongValuesButton" type="button" value="set wrong values" onclick="setWrongValues()"/>
- <rich:message id="simpleInputMsg"
- ajaxRendered="#{richMessageBean.attributes['ajaxRendered'].value}"
- for="#{richMessageBean.attributes['for'].value}"
- keepTransient="#{richMessageBean.attributes['keepTransient'].value}"
- rendered="#{richMessageBean.attributes['rendered'].value}"
- showDetail="#{richMessageBean.attributes['showDetail'].value}"
- showSummary="#{richMessageBean.attributes['showSummary'].value}"
- dir="#{richMessageBean.attributes['dir'].value}"
- lang="#{richMessageBean.attributes['lang'].value}"
- onclick="#{richMessageBean.attributes['onclick'].value}"
- ondblclick="#{richMessageBean.attributes['ondblclick'].value}"
- onkeyup="#{richMessageBean.attributes['onkeyup'].value}"
- onkeydown="#{richMessageBean.attributes['onkeydown'].value}"
- onkeypress="#{richMessageBean.attributes['onkeypress'].value}"
- onmousedown="#{richMessageBean.attributes['onmousedown'].value}"
- onmousemove="#{richMessageBean.attributes['onmousemove'].value}"
- onmouseout="#{richMessageBean.attributes['onmouseout'].value}"
- onmouseover="#{richMessageBean.attributes['onmouseover'].value}"
- onmouseup="#{richMessageBean.attributes['onmouseup'].value}"
- style="#{richMessageBean.attributes['style'].value}"
- styleClass="#{richMessageBean.attributes['styleClass'].value}"
- title="#{richMessageBean.attributes['title'].value}"
- />
+ <rich:message id="simpleInputMsg"
+ ajaxRendered="#{richMessageBean.attributes['ajaxRendered'].value}"
+ for="#{richMessageBean.attributes['for'].value}"
+ keepTransient="#{richMessageBean.attributes['keepTransient'].value}"
+ rendered="#{richMessageBean.attributes['rendered'].value}"
+ showDetail="#{richMessageBean.attributes['showDetail'].value}"
+ showSummary="#{richMessageBean.attributes['showSummary'].value}"
+ dir="#{richMessageBean.attributes['dir'].value}"
+ lang="#{richMessageBean.attributes['lang'].value}"
+ onclick="#{richMessageBean.attributes['onclick'].value}"
+ ondblclick="#{richMessageBean.attributes['ondblclick'].value}"
+ onkeyup="#{richMessageBean.attributes['onkeyup'].value}"
+ onkeydown="#{richMessageBean.attributes['onkeydown'].value}"
+ onkeypress="#{richMessageBean.attributes['onkeypress'].value}"
+ onmousedown="#{richMessageBean.attributes['onmousedown'].value}"
+ onmousemove="#{richMessageBean.attributes['onmousemove'].value}"
+ onmouseout="#{richMessageBean.attributes['onmouseout'].value}"
+ onmouseover="#{richMessageBean.attributes['onmouseover'].value}"
+ onmouseup="#{richMessageBean.attributes['onmouseup'].value}"
+ style="#{richMessageBean.attributes['style'].value}"
+ styleClass="#{richMessageBean.attributes['styleClass'].value}"
+ title="#{richMessageBean.attributes['title'].value}"
+ />
<h:panelGrid columns="3">
- <h:outputLabel for="simpleInput1" value="#{minMaxBean.description}" />
- <h:inputText id="simpleInput1" value="#{minMaxBean.value}" label="Input 1" converter="#{minMaxBean.converter}"/>
- <rich:message id="simpleInputMsg1"
- ajaxRendered="#{richMessageBean.attributes['ajaxRendered'].value}"
- for="simpleInput1"
- keepTransient="#{richMessageBean.attributes['keepTransient'].value}"
- rendered="#{richMessageBean.attributes['rendered'].value}"
- showDetail="#{richMessageBean.attributes['showDetail'].value}"
- showSummary="#{richMessageBean.attributes['showSummary'].value}"
- dir="#{richMessageBean.attributes['dir'].value}"
- lang="#{richMessageBean.attributes['lang'].value}"
- onclick="#{richMessageBean.attributes['onclick'].value}"
- ondblclick="#{richMessageBean.attributes['ondblclick'].value}"
- onkeyup="#{richMessageBean.attributes['onkeyup'].value}"
- onkeydown="#{richMessageBean.attributes['onkeydown'].value}"
- onkeypress="#{richMessageBean.attributes['onkeypress'].value}"
- onmousedown="#{richMessageBean.attributes['onmousedown'].value}"
- onmousemove="#{richMessageBean.attributes['onmousemove'].value}"
- onmouseout="#{richMessageBean.attributes['onmouseout'].value}"
- onmouseover="#{richMessageBean.attributes['onmouseover'].value}"
- onmouseup="#{richMessageBean.attributes['onmouseup'].value}"
- style="#{richMessageBean.attributes['style'].value}"
- styleClass="#{richMessageBean.attributes['styleClass'].value}"
- title="#{richMessageBean.attributes['title'].value}"
- />
-
- <h:outputLabel for="simpleInput2" value="#{minMaxBean.description}" />
- <h:inputText id="simpleInput2" value="#{minMaxBean.value}" label="Input 2" converter="#{minMaxBean.converter}"/>
- <rich:message id="simpleInputMsg2"
- ajaxRendered="#{richMessageBean.attributes['ajaxRendered'].value}"
- for="simpleInput2"
- keepTransient="#{richMessageBean.attributes['keepTransient'].value}"
- rendered="#{richMessageBean.attributes['rendered'].value}"
- showDetail="#{richMessageBean.attributes['showDetail'].value}"
- showSummary="#{richMessageBean.attributes['showSummary'].value}"
- dir="#{richMessageBean.attributes['dir'].value}"
- lang="#{richMessageBean.attributes['lang'].value}"
- onclick="#{richMessageBean.attributes['onclick'].value}"
- ondblclick="#{richMessageBean.attributes['ondblclick'].value}"
- onkeyup="#{richMessageBean.attributes['onkeyup'].value}"
- onkeydown="#{richMessageBean.attributes['onkeydown'].value}"
- onkeypress="#{richMessageBean.attributes['onkeypress'].value}"
- onmousedown="#{richMessageBean.attributes['onmousedown'].value}"
- onmousemove="#{richMessageBean.attributes['onmousemove'].value}"
- onmouseout="#{richMessageBean.attributes['onmouseout'].value}"
- onmouseover="#{richMessageBean.attributes['onmouseover'].value}"
- onmouseup="#{richMessageBean.attributes['onmouseup'].value}"
- style="#{richMessageBean.attributes['style'].value}"
- styleClass="#{richMessageBean.attributes['styleClass'].value}"
- title="#{richMessageBean.attributes['title'].value}"
- />
+ <h:outputLabel for="simpleInput1" value="#{minMaxBean.description}" />
+ <h:inputText id="simpleInput1" value="#{minMaxBean.value}" label="Input 1" converter="#{minMaxBean.converter}"/>
+ <rich:message id="simpleInputMsg1"
+ ajaxRendered="#{richMessageBean.attributes['ajaxRendered'].value}"
+ for="simpleInput1"
+ keepTransient="#{richMessageBean.attributes['keepTransient'].value}"
+ rendered="#{richMessageBean.attributes['rendered'].value}"
+ showDetail="#{richMessageBean.attributes['showDetail'].value}"
+ showSummary="#{richMessageBean.attributes['showSummary'].value}"
+ dir="#{richMessageBean.attributes['dir'].value}"
+ lang="#{richMessageBean.attributes['lang'].value}"
+ onclick="#{richMessageBean.attributes['onclick'].value}"
+ ondblclick="#{richMessageBean.attributes['ondblclick'].value}"
+ onkeyup="#{richMessageBean.attributes['onkeyup'].value}"
+ onkeydown="#{richMessageBean.attributes['onkeydown'].value}"
+ onkeypress="#{richMessageBean.attributes['onkeypress'].value}"
+ onmousedown="#{richMessageBean.attributes['onmousedown'].value}"
+ onmousemove="#{richMessageBean.attributes['onmousemove'].value}"
+ onmouseout="#{richMessageBean.attributes['onmouseout'].value}"
+ onmouseover="#{richMessageBean.attributes['onmouseover'].value}"
+ onmouseup="#{richMessageBean.attributes['onmouseup'].value}"
+ style="#{richMessageBean.attributes['style'].value}"
+ styleClass="#{richMessageBean.attributes['styleClass'].value}"
+ title="#{richMessageBean.attributes['title'].value}"
+ />
+
+ <h:outputLabel for="simpleInput2" value="#{minMaxBean.description}" />
+ <h:inputText id="simpleInput2" value="#{minMaxBean.value}" label="Input 2" converter="#{minMaxBean.converter}"/>
+ <rich:message id="simpleInputMsg2"
+ ajaxRendered="#{richMessageBean.attributes['ajaxRendered'].value}"
+ for="simpleInput2"
+ keepTransient="#{richMessageBean.attributes['keepTransient'].value}"
+ rendered="#{richMessageBean.attributes['rendered'].value}"
+ showDetail="#{richMessageBean.attributes['showDetail'].value}"
+ showSummary="#{richMessageBean.attributes['showSummary'].value}"
+ dir="#{richMessageBean.attributes['dir'].value}"
+ lang="#{richMessageBean.attributes['lang'].value}"
+ onclick="#{richMessageBean.attributes['onclick'].value}"
+ ondblclick="#{richMessageBean.attributes['ondblclick'].value}"
+ onkeyup="#{richMessageBean.attributes['onkeyup'].value}"
+ onkeydown="#{richMessageBean.attributes['onkeydown'].value}"
+ onkeypress="#{richMessageBean.attributes['onkeypress'].value}"
+ onmousedown="#{richMessageBean.attributes['onmousedown'].value}"
+ onmousemove="#{richMessageBean.attributes['onmousemove'].value}"
+ onmouseout="#{richMessageBean.attributes['onmouseout'].value}"
+ onmouseover="#{richMessageBean.attributes['onmouseover'].value}"
+ onmouseup="#{richMessageBean.attributes['onmouseup'].value}"
+ style="#{richMessageBean.attributes['style'].value}"
+ styleClass="#{richMessageBean.attributes['styleClass'].value}"
+ title="#{richMessageBean.attributes['title'].value}"
+ />
</h:panelGrid>
<br/>
@@ -148,7 +148,7 @@
</ui:define>
<ui:define name="outOfTemplateAfter">
- <metamer:attributes value="#{richMessageBean.attributes}" id="attributes"/>
+ <metamer:attributes value="#{richMessageBean.attributes}" id="attributes"/>
</ui:define>
</ui:composition>
Modified: modules/tests/metamer/trunk/application/src/main/webapp/components/richMessage/list.xhtml
===================================================================
--- modules/tests/metamer/trunk/application/src/main/webapp/components/richMessage/list.xhtml 2011-05-06 18:23:48 UTC (rev 22478)
+++ modules/tests/metamer/trunk/application/src/main/webapp/components/richMessage/list.xhtml 2011-05-06 18:27:42 UTC (rev 22479)
@@ -38,7 +38,7 @@
<metamer:testPageLink id="jsr303" outcome="jsr303" value="JSR-303 Bean Validation">
Page containing input with JSR-303 validator.
</metamer:testPageLink>
-
+
<metamer:testPageLink id="jsfValidator" outcome="jsfValidator" value="Simple JSF Validation">
Page containing input with simple JSF validator.
</metamer:testPageLink>
Modified: modules/tests/metamer/trunk/application/src/main/webapp/components/richMessages/csv.xhtml
===================================================================
--- modules/tests/metamer/trunk/application/src/main/webapp/components/richMessages/csv.xhtml 2011-05-06 18:23:48 UTC (rev 22478)
+++ modules/tests/metamer/trunk/application/src/main/webapp/components/richMessages/csv.xhtml 2011-05-06 18:27:42 UTC (rev 22479)
@@ -48,87 +48,87 @@
<ui:define name="component">
<script type="text/javascript">
function setCorrectValues() {
- $('input[id$=simpleInput1]').val('10');
- $('input[id$=simpleInput2]').val('10');
+ $('input[id$=simpleInput1]').val('10');
+ $('input[id$=simpleInput2]').val('10');
}
function setWrongValues() {
- $('input[id$=simpleInput1]').val('200');
- $('input[id$=simpleInput2]').val('200');
+ $('input[id$=simpleInput1]').val('200');
+ $('input[id$=simpleInput2]').val('200');
}
</script>
<input id="setCorrectValuesButton" type="button" value="set correct values" onclick="setCorrectValues()"/>
<input id="setWrongValuesButton" type="button" value="set wrong values" onclick="setWrongValues()"/>
-
+
<fieldset title="Msgs1 - with for attribute" >
- <legend>Messages1 - with 'for' attribute</legend>
- <rich:messages id="msgs1"
- for="#{richMessagesBean.attributes['for'].value}"
- ajaxRendered="#{richMessagesBean.attributes['ajaxRendered'].value}"
- keepTransient="#{richMessagesBean.attributes['keepTransient'].value}"
- rendered="#{richMessagesBean.attributes['rendered'].value}"
- showDetail="#{richMessagesBean.attributes['showDetail'].value}"
- showSummary="#{richMessagesBean.attributes['showSummary'].value}"
- dir="#{richMessagesBean.attributes['dir'].value}"
- lang="#{richMessagesBean.attributes['lang'].value}"
- style="#{richMessagesBean.attributes['style'].value}"
- styleClass="#{richMessagesBean.attributes['styleClass'].value}"
- title="#{richMessagesBean.attributes['title'].value}"
- onclick="#{richMessagesBean.attributes['onclick'].value}"
- ondblclick="#{richMessagesBean.attributes['ondblclick'].value}"
- onkeydown="#{richMessagesBean.attributes['onkeydown'].value}"
- onkeypress="#{richMessagesBean.attributes['onkeypress'].value}"
- onkeyup="#{richMessagesBean.attributes['onkeyup'].value}"
- onmousedown="#{richMessagesBean.attributes['onmousedown'].value}"
- onmousemove="#{richMessagesBean.attributes['onmousemove'].value}"
- onmouseout="#{richMessagesBean.attributes['onmouseout'].value}"
- onmouseover="#{richMessagesBean.attributes['onmouseover'].value}"
- onmouseup="#{richMessagesBean.attributes['onmouseup'].value}"
- />
- </fieldset>
-
- <br/>
-
+ <legend>Messages1 - with 'for' attribute</legend>
+ <rich:messages id="msgs1"
+ for="#{richMessagesBean.attributes['for'].value}"
+ ajaxRendered="#{richMessagesBean.attributes['ajaxRendered'].value}"
+ keepTransient="#{richMessagesBean.attributes['keepTransient'].value}"
+ rendered="#{richMessagesBean.attributes['rendered'].value}"
+ showDetail="#{richMessagesBean.attributes['showDetail'].value}"
+ showSummary="#{richMessagesBean.attributes['showSummary'].value}"
+ dir="#{richMessagesBean.attributes['dir'].value}"
+ lang="#{richMessagesBean.attributes['lang'].value}"
+ style="#{richMessagesBean.attributes['style'].value}"
+ styleClass="#{richMessagesBean.attributes['styleClass'].value}"
+ title="#{richMessagesBean.attributes['title'].value}"
+ onclick="#{richMessagesBean.attributes['onclick'].value}"
+ ondblclick="#{richMessagesBean.attributes['ondblclick'].value}"
+ onkeydown="#{richMessagesBean.attributes['onkeydown'].value}"
+ onkeypress="#{richMessagesBean.attributes['onkeypress'].value}"
+ onkeyup="#{richMessagesBean.attributes['onkeyup'].value}"
+ onmousedown="#{richMessagesBean.attributes['onmousedown'].value}"
+ onmousemove="#{richMessagesBean.attributes['onmousemove'].value}"
+ onmouseout="#{richMessagesBean.attributes['onmouseout'].value}"
+ onmouseover="#{richMessagesBean.attributes['onmouseover'].value}"
+ onmouseup="#{richMessagesBean.attributes['onmouseup'].value}"
+ />
+ </fieldset>
+
+ <br/>
+
<fieldset title="Msgs2 - with globalOnly attribute">
- <legend>Messages2 - without 'for' but 'globalOnly' attribute instead</legend>
- <rich:messages id="msgs2"
- ajaxRendered="#{richMessagesBean.attributes['ajaxRendered'].value}"
- globalOnly="#{richMessagesBean.attributes['globalOnly'].value}"
- keepTransient="#{richMessagesBean.attributes['keepTransient'].value}"
- rendered="#{richMessagesBean.attributes['rendered'].value}"
- showDetail="#{richMessagesBean.attributes['showDetail'].value}"
- showSummary="#{richMessagesBean.attributes['showSummary'].value}"
- dir="#{richMessagesBean.attributes['dir'].value}"
- lang="#{richMessagesBean.attributes['lang'].value}"
- style="#{richMessagesBean.attributes['style'].value}"
- styleClass="#{richMessagesBean.attributes['styleClass'].value}"
- title="#{richMessagesBean.attributes['title'].value}"
- onclick="#{richMessagesBean.attributes['onclick'].value}"
- ondblclick="#{richMessagesBean.attributes['ondblclick'].value}"
- onkeydown="#{richMessagesBean.attributes['onkeydown'].value}"
- onkeypress="#{richMessagesBean.attributes['onkeypress'].value}"
- onkeyup="#{richMessagesBean.attributes['onkeyup'].value}"
- onmousedown="#{richMessagesBean.attributes['onmousedown'].value}"
- onmousemove="#{richMessagesBean.attributes['onmousemove'].value}"
- onmouseout="#{richMessagesBean.attributes['onmouseout'].value}"
- onmouseover="#{richMessagesBean.attributes['onmouseover'].value}"
- onmouseup="#{richMessagesBean.attributes['onmouseup'].value}"
- />
+ <legend>Messages2 - without 'for' but 'globalOnly' attribute instead</legend>
+ <rich:messages id="msgs2"
+ ajaxRendered="#{richMessagesBean.attributes['ajaxRendered'].value}"
+ globalOnly="#{richMessagesBean.attributes['globalOnly'].value}"
+ keepTransient="#{richMessagesBean.attributes['keepTransient'].value}"
+ rendered="#{richMessagesBean.attributes['rendered'].value}"
+ showDetail="#{richMessagesBean.attributes['showDetail'].value}"
+ showSummary="#{richMessagesBean.attributes['showSummary'].value}"
+ dir="#{richMessagesBean.attributes['dir'].value}"
+ lang="#{richMessagesBean.attributes['lang'].value}"
+ style="#{richMessagesBean.attributes['style'].value}"
+ styleClass="#{richMessagesBean.attributes['styleClass'].value}"
+ title="#{richMessagesBean.attributes['title'].value}"
+ onclick="#{richMessagesBean.attributes['onclick'].value}"
+ ondblclick="#{richMessagesBean.attributes['ondblclick'].value}"
+ onkeydown="#{richMessagesBean.attributes['onkeydown'].value}"
+ onkeypress="#{richMessagesBean.attributes['onkeypress'].value}"
+ onkeyup="#{richMessagesBean.attributes['onkeyup'].value}"
+ onmousedown="#{richMessagesBean.attributes['onmousedown'].value}"
+ onmousemove="#{richMessagesBean.attributes['onmousemove'].value}"
+ onmouseout="#{richMessagesBean.attributes['onmouseout'].value}"
+ onmouseover="#{richMessagesBean.attributes['onmouseover'].value}"
+ onmouseup="#{richMessagesBean.attributes['onmouseup'].value}"
+ />
</fieldset>
-
+
<h:panelGrid columns="3">
- <h:outputLabel for="simpleInput1" value="#{multipleValidationRulesBean.description}" />
+ <h:outputLabel for="simpleInput1" value="#{multipleValidationRulesBean.description}" />
<h:inputText id="simpleInput1" value="#{multipleValidationRulesBean.value}" label="Input 1"
- converter="#{multipleValidationRulesBean.converter}">
- <rich:validator />
- </h:inputText>
+ converter="#{multipleValidationRulesBean.converter}">
+ <rich:validator />
+ </h:inputText>
<rich:message id="simpleInputMsg1" for="simpleInput1" ajaxRendered="true" />
-
+
<h:outputLabel for="simpleInput2" value="#{multipleValidationRulesBean.description}" />
<h:inputText id="simpleInput2" value="#{multipleValidationRulesBean.value}" label="Input 2"
- converter="#{multipleValidationRulesBean.converter}">
- <rich:validator />
+ converter="#{multipleValidationRulesBean.converter}">
+ <rich:validator />
</h:inputText>
<rich:message id="simpleInputMsg2" for="simpleInput2" ajaxRendered="true" />
</h:panelGrid>
@@ -138,8 +138,8 @@
<h:commandButton id="hButton" value="h:commandButton" style="margin-right: 10px;"/>
<a4j:commandButton id="a4jButton" value="a4j:commandButton"/>
<a4j:commandButton id="generateMsgsBtn" value="Generate Msgs"
- actionListener="#{richMessagesBean.generateFacesError}" />
-
+ actionListener="#{richMessagesBean.generateFacesError}" />
+
<br/>
<rich:messages id="msgs" />
Modified: modules/tests/metamer/trunk/application/src/main/webapp/components/richMessages/jsfValidator.xhtml
===================================================================
--- modules/tests/metamer/trunk/application/src/main/webapp/components/richMessages/jsfValidator.xhtml 2011-05-06 18:23:48 UTC (rev 22478)
+++ modules/tests/metamer/trunk/application/src/main/webapp/components/richMessages/jsfValidator.xhtml 2011-05-06 18:27:42 UTC (rev 22479)
@@ -39,102 +39,102 @@
</f:viewParam>
</f:metadata>
</ui:define>
-
+
<ui:define name="component">
- <script type="text/javascript">
- function setCorrectValues() {
- $('input[id$=simpleInput1]').val('10');
- $('input[id$=simpleInput2]').val('10');
- }
+ <script type="text/javascript">
+ function setCorrectValues() {
+ $('input[id$=simpleInput1]').val('10');
+ $('input[id$=simpleInput2]').val('10');
+ }
- function setWrongValues() {
- $('input[id$=simpleInput1]').val('200');
- $('input[id$=simpleInput2]').val('200');
- }
+ function setWrongValues() {
+ $('input[id$=simpleInput1]').val('200');
+ $('input[id$=simpleInput2]').val('200');
+ }
</script>
<input id="setCorrectValuesButton" type="button" value="set correct values" onclick="setCorrectValues()"/>
<input id="setWrongValuesButton" type="button" value="set wrong values" onclick="setWrongValues()"/>
-
+
<fieldset title="Msgs1 - with for attribute" >
- <legend>Messages1 - with 'for' attribute</legend>
- <rich:messages id="msgs1"
- for="#{richMessagesBean.attributes['for'].value}"
- ajaxRendered="#{richMessagesBean.attributes['ajaxRendered'].value}"
- keepTransient="#{richMessagesBean.attributes['keepTransient'].value}"
- rendered="#{richMessagesBean.attributes['rendered'].value}"
- showDetail="#{richMessagesBean.attributes['showDetail'].value}"
- showSummary="#{richMessagesBean.attributes['showSummary'].value}"
- dir="#{richMessagesBean.attributes['dir'].value}"
- lang="#{richMessagesBean.attributes['lang'].value}"
- style="#{richMessagesBean.attributes['style'].value}"
- styleClass="#{richMessagesBean.attributes['styleClass'].value}"
- title="#{richMessagesBean.attributes['title'].value}"
- onclick="#{richMessagesBean.attributes['onclick'].value}"
- ondblclick="#{richMessagesBean.attributes['ondblclick'].value}"
- onkeydown="#{richMessagesBean.attributes['onkeydown'].value}"
- onkeypress="#{richMessagesBean.attributes['onkeypress'].value}"
- onkeyup="#{richMessagesBean.attributes['onkeyup'].value}"
- onmousedown="#{richMessagesBean.attributes['onmousedown'].value}"
- onmousemove="#{richMessagesBean.attributes['onmousemove'].value}"
- onmouseout="#{richMessagesBean.attributes['onmouseout'].value}"
- onmouseover="#{richMessagesBean.attributes['onmouseover'].value}"
- onmouseup="#{richMessagesBean.attributes['onmouseup'].value}"
- />
- </fieldset>
-
- <br/>
-
+ <legend>Messages1 - with 'for' attribute</legend>
+ <rich:messages id="msgs1"
+ for="#{richMessagesBean.attributes['for'].value}"
+ ajaxRendered="#{richMessagesBean.attributes['ajaxRendered'].value}"
+ keepTransient="#{richMessagesBean.attributes['keepTransient'].value}"
+ rendered="#{richMessagesBean.attributes['rendered'].value}"
+ showDetail="#{richMessagesBean.attributes['showDetail'].value}"
+ showSummary="#{richMessagesBean.attributes['showSummary'].value}"
+ dir="#{richMessagesBean.attributes['dir'].value}"
+ lang="#{richMessagesBean.attributes['lang'].value}"
+ style="#{richMessagesBean.attributes['style'].value}"
+ styleClass="#{richMessagesBean.attributes['styleClass'].value}"
+ title="#{richMessagesBean.attributes['title'].value}"
+ onclick="#{richMessagesBean.attributes['onclick'].value}"
+ ondblclick="#{richMessagesBean.attributes['ondblclick'].value}"
+ onkeydown="#{richMessagesBean.attributes['onkeydown'].value}"
+ onkeypress="#{richMessagesBean.attributes['onkeypress'].value}"
+ onkeyup="#{richMessagesBean.attributes['onkeyup'].value}"
+ onmousedown="#{richMessagesBean.attributes['onmousedown'].value}"
+ onmousemove="#{richMessagesBean.attributes['onmousemove'].value}"
+ onmouseout="#{richMessagesBean.attributes['onmouseout'].value}"
+ onmouseover="#{richMessagesBean.attributes['onmouseover'].value}"
+ onmouseup="#{richMessagesBean.attributes['onmouseup'].value}"
+ />
+ </fieldset>
+
+ <br/>
+
<fieldset title="Msgs2 - with globalOnly attribute">
- <legend>Messages2 - without 'for' but 'globalOnly' attribute instead</legend>
- <rich:messages id="msgs2"
- ajaxRendered="#{richMessagesBean.attributes['ajaxRendered'].value}"
- globalOnly="#{richMessagesBean.attributes['globalOnly'].value}"
- keepTransient="#{richMessagesBean.attributes['keepTransient'].value}"
- rendered="#{richMessagesBean.attributes['rendered'].value}"
- showDetail="#{richMessagesBean.attributes['showDetail'].value}"
- showSummary="#{richMessagesBean.attributes['showSummary'].value}"
- dir="#{richMessagesBean.attributes['dir'].value}"
- lang="#{richMessagesBean.attributes['lang'].value}"
- style="#{richMessagesBean.attributes['style'].value}"
- styleClass="#{richMessagesBean.attributes['styleClass'].value}"
- title="#{richMessagesBean.attributes['title'].value}"
- onclick="#{richMessagesBean.attributes['onclick'].value}"
- ondblclick="#{richMessagesBean.attributes['ondblclick'].value}"
- onkeydown="#{richMessagesBean.attributes['onkeydown'].value}"
- onkeypress="#{richMessagesBean.attributes['onkeypress'].value}"
- onkeyup="#{richMessagesBean.attributes['onkeyup'].value}"
- onmousedown="#{richMessagesBean.attributes['onmousedown'].value}"
- onmousemove="#{richMessagesBean.attributes['onmousemove'].value}"
- onmouseout="#{richMessagesBean.attributes['onmouseout'].value}"
- onmouseover="#{richMessagesBean.attributes['onmouseover'].value}"
- onmouseup="#{richMessagesBean.attributes['onmouseup'].value}"
- />
+ <legend>Messages2 - without 'for' but 'globalOnly' attribute instead</legend>
+ <rich:messages id="msgs2"
+ ajaxRendered="#{richMessagesBean.attributes['ajaxRendered'].value}"
+ globalOnly="#{richMessagesBean.attributes['globalOnly'].value}"
+ keepTransient="#{richMessagesBean.attributes['keepTransient'].value}"
+ rendered="#{richMessagesBean.attributes['rendered'].value}"
+ showDetail="#{richMessagesBean.attributes['showDetail'].value}"
+ showSummary="#{richMessagesBean.attributes['showSummary'].value}"
+ dir="#{richMessagesBean.attributes['dir'].value}"
+ lang="#{richMessagesBean.attributes['lang'].value}"
+ style="#{richMessagesBean.attributes['style'].value}"
+ styleClass="#{richMessagesBean.attributes['styleClass'].value}"
+ title="#{richMessagesBean.attributes['title'].value}"
+ onclick="#{richMessagesBean.attributes['onclick'].value}"
+ ondblclick="#{richMessagesBean.attributes['ondblclick'].value}"
+ onkeydown="#{richMessagesBean.attributes['onkeydown'].value}"
+ onkeypress="#{richMessagesBean.attributes['onkeypress'].value}"
+ onkeyup="#{richMessagesBean.attributes['onkeyup'].value}"
+ onmousedown="#{richMessagesBean.attributes['onmousedown'].value}"
+ onmousemove="#{richMessagesBean.attributes['onmousemove'].value}"
+ onmouseout="#{richMessagesBean.attributes['onmouseout'].value}"
+ onmouseover="#{richMessagesBean.attributes['onmouseover'].value}"
+ onmouseup="#{richMessagesBean.attributes['onmouseup'].value}"
+ />
</fieldset>
-
+
<h:panelGrid columns="3">
- <h:outputLabel for="simpleInput1" value="#{multipleValidationRulesBean.description}" />
+ <h:outputLabel for="simpleInput1" value="#{multipleValidationRulesBean.description}" />
<h:inputText id="simpleInput1" value="#{richMessagesBean.simpleInput1}" label="Input 1" >
- <f:validateLongRange minimum="5" maximum="150" />
- <f:validateLength maximum="2" />
+ <f:validateLongRange minimum="5" maximum="150" />
+ <f:validateLength maximum="2" />
</h:inputText>
<rich:message id="simpleInputMsg1" ajaxRendered="true" for="simpleInput1" />
-
- <h:outputLabel for="simpleInput2" value="#{multipleValidationRulesBean.description}" />
+
+ <h:outputLabel for="simpleInput2" value="#{multipleValidationRulesBean.description}" />
<h:inputText id="simpleInput2" value="#{richMessagesBean.simpleInput2}" label="Input 2" >
- <f:validateLongRange minimum="5" maximum="150" />
- <f:validateLength maximum="2" />
+ <f:validateLongRange minimum="5" maximum="150" />
+ <f:validateLength maximum="2" />
</h:inputText>
<rich:message id="simpleInputMsg2" ajaxRendered="true" for="simpleInput2" />
</h:panelGrid>
-
+
<br/>
-
+
<h:commandButton id="hButton" value="h:commandButton" style="margin-right: 10px;"/>
<a4j:commandButton id="a4jButton" value="a4j:commandButton"/>
<a4j:commandButton id="generateMsgsBtn" value="Generate Msgs"
- actionListener="#{richMessagesBean.generateFacesError}" />
-
+ actionListener="#{richMessagesBean.generateFacesError}" />
+
<br/>
<rich:messages id="msgs" />
Modified: modules/tests/metamer/trunk/application/src/main/webapp/components/richMessages/jsr303.xhtml
===================================================================
--- modules/tests/metamer/trunk/application/src/main/webapp/components/richMessages/jsr303.xhtml 2011-05-06 18:23:48 UTC (rev 22478)
+++ modules/tests/metamer/trunk/application/src/main/webapp/components/richMessages/jsr303.xhtml 2011-05-06 18:27:42 UTC (rev 22479)
@@ -48,87 +48,87 @@
<ui:define name="component">
<script type="text/javascript">
function setCorrectValues() {
- $('input[id$=simpleInput1]').val('10');
- $('input[id$=simpleInput2]').val('10');
+ $('input[id$=simpleInput1]').val('10');
+ $('input[id$=simpleInput2]').val('10');
}
function setWrongValues() {
- $('input[id$=simpleInput1]').val('200');
- $('input[id$=simpleInput2]').val('200');
+ $('input[id$=simpleInput1]').val('200');
+ $('input[id$=simpleInput2]').val('200');
}
</script>
<input id="setCorrectValuesButton" type="button" value="set correct values" onclick="setCorrectValues()"/>
<input id="setWrongValuesButton" type="button" value="set wrong values" onclick="setWrongValues()"/>
-
+
<br/>
- <fieldset title="Msgs1 - with for attribute" >
- <legend>Messages1 - with 'for' attribute</legend>
- <rich:messages id="msgs1"
- for="#{richMessagesBean.attributes['for'].value}"
- ajaxRendered="#{richMessagesBean.attributes['ajaxRendered'].value}"
- keepTransient="#{richMessagesBean.attributes['keepTransient'].value}"
- rendered="#{richMessagesBean.attributes['rendered'].value}"
- showDetail="#{richMessagesBean.attributes['showDetail'].value}"
- showSummary="#{richMessagesBean.attributes['showSummary'].value}"
- dir="#{richMessagesBean.attributes['dir'].value}"
- lang="#{richMessagesBean.attributes['lang'].value}"
- style="#{richMessagesBean.attributes['style'].value}"
- styleClass="#{richMessagesBean.attributes['styleClass'].value}"
- title="#{richMessagesBean.attributes['title'].value}"
- onclick="#{richMessagesBean.attributes['onclick'].value}"
- ondblclick="#{richMessagesBean.attributes['ondblclick'].value}"
- onkeydown="#{richMessagesBean.attributes['onkeydown'].value}"
- onkeypress="#{richMessagesBean.attributes['onkeypress'].value}"
- onkeyup="#{richMessagesBean.attributes['onkeyup'].value}"
- onmousedown="#{richMessagesBean.attributes['onmousedown'].value}"
- onmousemove="#{richMessagesBean.attributes['onmousemove'].value}"
- onmouseout="#{richMessagesBean.attributes['onmouseout'].value}"
- onmouseover="#{richMessagesBean.attributes['onmouseover'].value}"
- onmouseup="#{richMessagesBean.attributes['onmouseup'].value}"
- />
- </fieldset>
-
- <br/>
-
+ <fieldset title="Msgs1 - with for attribute" >
+ <legend>Messages1 - with 'for' attribute</legend>
+ <rich:messages id="msgs1"
+ for="#{richMessagesBean.attributes['for'].value}"
+ ajaxRendered="#{richMessagesBean.attributes['ajaxRendered'].value}"
+ keepTransient="#{richMessagesBean.attributes['keepTransient'].value}"
+ rendered="#{richMessagesBean.attributes['rendered'].value}"
+ showDetail="#{richMessagesBean.attributes['showDetail'].value}"
+ showSummary="#{richMessagesBean.attributes['showSummary'].value}"
+ dir="#{richMessagesBean.attributes['dir'].value}"
+ lang="#{richMessagesBean.attributes['lang'].value}"
+ style="#{richMessagesBean.attributes['style'].value}"
+ styleClass="#{richMessagesBean.attributes['styleClass'].value}"
+ title="#{richMessagesBean.attributes['title'].value}"
+ onclick="#{richMessagesBean.attributes['onclick'].value}"
+ ondblclick="#{richMessagesBean.attributes['ondblclick'].value}"
+ onkeydown="#{richMessagesBean.attributes['onkeydown'].value}"
+ onkeypress="#{richMessagesBean.attributes['onkeypress'].value}"
+ onkeyup="#{richMessagesBean.attributes['onkeyup'].value}"
+ onmousedown="#{richMessagesBean.attributes['onmousedown'].value}"
+ onmousemove="#{richMessagesBean.attributes['onmousemove'].value}"
+ onmouseout="#{richMessagesBean.attributes['onmouseout'].value}"
+ onmouseover="#{richMessagesBean.attributes['onmouseover'].value}"
+ onmouseup="#{richMessagesBean.attributes['onmouseup'].value}"
+ />
+ </fieldset>
+
+ <br/>
+
<fieldset title="Msgs2 - with globalOnly attribute">
- <legend>Messages2 - without 'for' but 'globalOnly' attribute instead</legend>
- <rich:messages id="msgs2"
- ajaxRendered="#{richMessagesBean.attributes['ajaxRendered'].value}"
- globalOnly="#{richMessagesBean.attributes['globalOnly'].value}"
- keepTransient="#{richMessagesBean.attributes['keepTransient'].value}"
- rendered="#{richMessagesBean.attributes['rendered'].value}"
- showDetail="#{richMessagesBean.attributes['showDetail'].value}"
- showSummary="#{richMessagesBean.attributes['showSummary'].value}"
- dir="#{richMessagesBean.attributes['dir'].value}"
- lang="#{richMessagesBean.attributes['lang'].value}"
- style="#{richMessagesBean.attributes['style'].value}"
- styleClass="#{richMessagesBean.attributes['styleClass'].value}"
- title="#{richMessagesBean.attributes['title'].value}"
- onclick="#{richMessagesBean.attributes['onclick'].value}"
- ondblclick="#{richMessagesBean.attributes['ondblclick'].value}"
- onkeydown="#{richMessagesBean.attributes['onkeydown'].value}"
- onkeypress="#{richMessagesBean.attributes['onkeypress'].value}"
- onkeyup="#{richMessagesBean.attributes['onkeyup'].value}"
- onmousedown="#{richMessagesBean.attributes['onmousedown'].value}"
- onmousemove="#{richMessagesBean.attributes['onmousemove'].value}"
- onmouseout="#{richMessagesBean.attributes['onmouseout'].value}"
- onmouseover="#{richMessagesBean.attributes['onmouseover'].value}"
- onmouseup="#{richMessagesBean.attributes['onmouseup'].value}"
- />
+ <legend>Messages2 - without 'for' but 'globalOnly' attribute instead</legend>
+ <rich:messages id="msgs2"
+ ajaxRendered="#{richMessagesBean.attributes['ajaxRendered'].value}"
+ globalOnly="#{richMessagesBean.attributes['globalOnly'].value}"
+ keepTransient="#{richMessagesBean.attributes['keepTransient'].value}"
+ rendered="#{richMessagesBean.attributes['rendered'].value}"
+ showDetail="#{richMessagesBean.attributes['showDetail'].value}"
+ showSummary="#{richMessagesBean.attributes['showSummary'].value}"
+ dir="#{richMessagesBean.attributes['dir'].value}"
+ lang="#{richMessagesBean.attributes['lang'].value}"
+ style="#{richMessagesBean.attributes['style'].value}"
+ styleClass="#{richMessagesBean.attributes['styleClass'].value}"
+ title="#{richMessagesBean.attributes['title'].value}"
+ onclick="#{richMessagesBean.attributes['onclick'].value}"
+ ondblclick="#{richMessagesBean.attributes['ondblclick'].value}"
+ onkeydown="#{richMessagesBean.attributes['onkeydown'].value}"
+ onkeypress="#{richMessagesBean.attributes['onkeypress'].value}"
+ onkeyup="#{richMessagesBean.attributes['onkeyup'].value}"
+ onmousedown="#{richMessagesBean.attributes['onmousedown'].value}"
+ onmousemove="#{richMessagesBean.attributes['onmousemove'].value}"
+ onmouseout="#{richMessagesBean.attributes['onmouseout'].value}"
+ onmouseover="#{richMessagesBean.attributes['onmouseover'].value}"
+ onmouseup="#{richMessagesBean.attributes['onmouseup'].value}"
+ />
</fieldset>
-
+
<h:panelGrid columns="3">
- <h:outputLabel for="simpleInput1" value="#{multipleValidationRulesBean.description}" />
- <h:inputText id="simpleInput1" value="#{multipleValidationRulesBean.value}" label="Input 1"
- converter="#{multipleValidationRulesBean.converter}" />
- <rich:message id="simpleInputMsg1" ajaxRendered="true" for="simpleInput1" />
-
- <h:outputLabel for="simpleInput2" value="#{multipleValidationRulesBean.description}" />
- <h:inputText id="simpleInput2" value="#{multipleValidationRulesBean.value}" label="Input 2"
- converter="#{multipleValidationRulesBean.converter}" />
- <rich:message id="simpleInputMsg2" ajaxRendered="true" for="simpleInput2" />
+ <h:outputLabel for="simpleInput1" value="#{multipleValidationRulesBean.description}" />
+ <h:inputText id="simpleInput1" value="#{multipleValidationRulesBean.value}" label="Input 1"
+ converter="#{multipleValidationRulesBean.converter}" />
+ <rich:message id="simpleInputMsg1" ajaxRendered="true" for="simpleInput1" />
+
+ <h:outputLabel for="simpleInput2" value="#{multipleValidationRulesBean.description}" />
+ <h:inputText id="simpleInput2" value="#{multipleValidationRulesBean.value}" label="Input 2"
+ converter="#{multipleValidationRulesBean.converter}" />
+ <rich:message id="simpleInputMsg2" ajaxRendered="true" for="simpleInput2" />
</h:panelGrid>
<br/>
@@ -136,15 +136,15 @@
<h:commandButton id="hButton" value="h:commandButton" style="margin-right: 10px;"/>
<a4j:commandButton id="a4jButton" value="a4j:commandButton"/>
<a4j:commandButton id="generateMsgsBtn" value="Generate Msgs"
- actionListener="#{richMessagesBean.generateFacesError}" />
-
+ actionListener="#{richMessagesBean.generateFacesError}" />
+
<br/>
<rich:messages id="msgs" />
</ui:define>
<ui:define name="outOfTemplateAfter">
- <metamer:attributes value="#{richMessagesBean.attributes}" id="attributes"/>
+ <metamer:attributes value="#{richMessagesBean.attributes}" id="attributes"/>
</ui:define>
</ui:composition>
Modified: modules/tests/metamer/trunk/application/src/main/webapp/components/richMessages/list.xhtml
===================================================================
--- modules/tests/metamer/trunk/application/src/main/webapp/components/richMessages/list.xhtml 2011-05-06 18:23:48 UTC (rev 22478)
+++ modules/tests/metamer/trunk/application/src/main/webapp/components/richMessages/list.xhtml 2011-05-06 18:27:42 UTC (rev 22479)
@@ -38,7 +38,7 @@
<metamer:testPageLink id="jsr303" outcome="jsr303" value="JSR-303 Bean Validation">
Page containing input with JSR-303 validator.
</metamer:testPageLink>
-
+
<metamer:testPageLink id="jsfValidator" outcome="jsfValidator" value="Simple JSF Validation">
Page containing input with simple JSF validator.
</metamer:testPageLink>
Modified: modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richMessage/AbstractRichMessageTest.java
===================================================================
--- modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richMessage/AbstractRichMessageTest.java 2011-05-06 18:23:48 UTC (rev 22478)
+++ modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richMessage/AbstractRichMessageTest.java 2011-05-06 18:27:42 UTC (rev 22479)
@@ -45,22 +45,19 @@
* @version $Revision$
*/
public abstract class AbstractRichMessageTest extends AbstractMetamerTest {
-
+
private static Logger logger = LoggerFactory.getLogger(AbstractRichMessageTest.class);
-
- protected RichMessageComponentAttributes attributes = new RichMessageComponentAttributes();
-
+ protected RichMessageComponentAttributes attributes = new RichMessageComponentAttributes();
// controls
protected JQueryLocator wrongValuesBtn = pjq("input[type=button][id$=setWrongValuesButton]");
protected JQueryLocator correctValuesBtn = pjq("input[type=button][id$=setCorrectValuesButton]");
protected JQueryLocator hCommandBtn = pjq("input[id$=hButton]");
protected JQueryLocator a4jCommandBtn = pjq("input[id$=a4jButton]");
-
// component's locators
protected static JQueryLocator message4Input1 = pjq("span[id$=simpleInputMsg1]");
protected static JQueryLocator message4Input2 = pjq("span[id$=simpleInputMsg2]");
protected static JQueryLocator messages = pjq("span[id$=msgs]");
-
+
/**
* Because of message and messages have many attributes very similar,
* this method helps test method distinguish between metamer
@@ -70,31 +67,34 @@
* @return ElementLocator for container with rich:message(s)
*/
public abstract JQueryLocator getTestElemLocator();
-
+
/**
* This method implementation specific for rich:message and rich:messages
* help distinguish between them, and return correct locator
* @return JQueryLocator for container with summary or detail of message(s) component
*/
public abstract JQueryLocator getSummaryElemLocator();
+
public abstract JQueryLocator getDetailElemLocator();
-
- public void testHtmlAttribute(ElementLocator<?> element, RichMessageAttributes attribute, String value) {
-
+
+ public void testHtmlAttribute(ElementLocator<?> element, RichMessageAttributes attribute, String value) {
+
AttributeLocator<?> attr = element.getAttribute(new Attribute(attribute.toString()));
selenium.type(pjq("input[id$=" + attribute + "Input]"), value);
- if (logger.isDebugEnabled()) logger.debug(" ######## attribute = " + attribute);
-
+ if (logger.isDebugEnabled()) {
+ logger.debug(" ######## attribute = " + attribute);
+ }
+
selenium.waitForPageToLoad();
-
+
// generate validation message
generateValidationMessages(false);
assertTrue(selenium.getAttribute(attr).contains(value), "Attribute " + attribute + " should contain \"" + value
+ "\".");
}
-
+
/**
* A helper method for testing javascripts events. It sets alert('testedevent') to the input field for given event
* and fires the event. Then it checks the message in the alert dialog.
@@ -110,7 +110,7 @@
String value = "metamerEvents += \"" + event.getEventName() + " \"";
guardHttp(selenium).type(eventInput, value);
-
+
// generate validation messages
generateValidationMessages(false);
@@ -119,7 +119,7 @@
waitGui.failWith("Attribute on" + event.getEventName() + " does not work correctly").until(
new EventFiredCondition(event));
}
-
+
/**
* A helper method for testing attribute "class". It sets "metamer-ftest-class" to the input field and checks that
* it was changed on the page.
@@ -134,14 +134,14 @@
final String styleClass = "metamer-ftest-class";
selenium.type(ref(attributesRoot, "input[id$=" + attribute + "Input]"), styleClass);
selenium.waitForPageToLoad();
-
+
generateValidationMessages(false);
JQueryLocator elementWhichHasntThatClass = jq(element.getRawLocator() + ":not(.{0})").format(styleClass);
assertTrue(selenium.isElementPresent(element));
assertFalse(selenium.isElementPresent(elementWhichHasntThatClass));
}
-
+
/**
* Set wrong values into appropriate inputs and generate validation
* messages by submitting form.
@@ -151,9 +151,9 @@
*
* @param Boolean <b>byAjax</b> - use to choose submit button type used to submit form
*/
- public void generateValidationMessages(Boolean byAjax) {
+ public void generateValidationMessages(Boolean byAjax) {
waitModel.until(elementPresent.locator(wrongValuesBtn));
- selenium.click(wrongValuesBtn);
+ selenium.click(wrongValuesBtn);
if (byAjax) {
waitModel.until(elementPresent.locator(a4jCommandBtn));
selenium.click(a4jCommandBtn);
@@ -163,137 +163,133 @@
selenium.waitForPageToLoad();
}
}
-
+
protected void waitForAttribute(RichMessageAttributes attr) {
- waitGui.until(attributeEquals
- .locator(getTestElemLocator().getAttribute(new Attribute(attr.toString())))
- .text(attr.toString()));
+ waitGui.until(attributeEquals.locator(getTestElemLocator().getAttribute(new Attribute(attr.toString()))).text(attr.toString()));
}
-
+
// ==================== test methods ====================
-
/**
* ajaxRendered attribute change behavior: messages are displayed
* after action performed by a4j:button (not only by h:command*)
*/
- public void testAjaxRendered(){
+ public void testAjaxRendered() {
// with set to false, element with id$=simpleInputMsg shouldn't appear
-
+
// by default is ajaxRendered set to true
generateValidationMessages(true);
waitGui.until(elementPresent.locator(getTestElemLocator()));
-
+
// then disable ajaxRendered
attributes.setAjaxRendered(Boolean.FALSE);
generateValidationMessages(true);
- waitGui.until(isNotDisplayed.locator(getTestElemLocator()));
+ waitGui.until(isNotDisplayed.locator(getTestElemLocator()));
}
-
+
/**
* This attribute could disable displaying message
*/
- public void testRendered(){
+ public void testRendered() {
// with set to false, element with id$=simpleInputMsg shouldn't appear
-
+
attributes.setRendered(Boolean.TRUE);
generateValidationMessages(false);
waitGui.until(elementPresent.locator(getTestElemLocator()));
-
+
// now disable rendering message
attributes.setRendered(Boolean.FALSE);
generateValidationMessages(false);
waitGui.until(isNotDisplayed.locator(getTestElemLocator()));
}
-
+
/**
* Attribute for managing display Summary
*/
public void testShowSummary() {
// span with class=rf-msg-sum should appear when set to true
-
+
attributes.setShowSummary(Boolean.TRUE);
generateValidationMessages(false);
waitModel.until(elementPresent.locator(getSummaryElemLocator()));
-
+
attributes.setShowSummary(Boolean.FALSE);
generateValidationMessages(false);
waitGui.until(isNotDisplayed.locator(getSummaryElemLocator()));
}
-
+
/**
* Attribute for managing display Detail
*/
public void testShowDetail() {
// span with class=rf-msg-det should appear when set to true
-
+
attributes.setShowDetail(Boolean.TRUE);
generateValidationMessages(false);
waitGui.until(elementPresent.locator(getDetailElemLocator()));
-
+
attributes.setShowDetail(Boolean.FALSE);
generateValidationMessages(false);
waitGui.until(isNotDisplayed.locator(getDetailElemLocator()));
}
-
+
public void testTitle() {
testHtmlAttribute(getTestElemLocator(), RichMessageAttributes.TITLE, "Title test");
}
-
- public void testDir(){
+
+ public void testDir() {
testHtmlAttribute(getTestElemLocator(), RichMessageAttributes.DIR, "rtl");
}
-
- public void testLang(){
+
+ public void testLang() {
testHtmlAttribute(getTestElemLocator(), RichMessageAttributes.LANG, "US.en");
}
-
- public void testStyle(){
+
+ public void testStyle() {
testHtmlAttribute(getTestElemLocator(), RichMessageAttributes.STYLE, "color: blue;");
}
-
+
public void testStyleClass() {
// attribute styleClass is propagated as class attribute in target HTML element
testStyleClass(getTestElemLocator(), RichMessageAttributes.STYLE_CLASS.toString());
}
-
+
public void testOnClick() {
testFireEvent(Event.CLICK, getTestElemLocator());
}
-
+
public void testOnDblClick() {
testFireEvent(Event.DBLCLICK, getTestElemLocator());
}
-
+
public void testOnKeyDown() {
testFireEvent(Event.KEYDOWN, getTestElemLocator());
}
-
+
public void testOnKeyPress() {
testFireEvent(Event.KEYPRESS, getTestElemLocator());
}
-
+
public void testOnKeyUp() {
testFireEvent(Event.KEYUP, getTestElemLocator());
}
-
+
public void testOnMouseDown() {
testFireEvent(Event.MOUSEDOWN, getTestElemLocator());
}
-
+
public void testOnMouseMove() {
testFireEvent(Event.MOUSEMOVE, getTestElemLocator());
}
-
+
public void testOnMouseOut() {
testFireEvent(Event.MOUSEOUT, getTestElemLocator());
}
-
+
public void testOnMouseOver() {
testFireEvent(Event.MOUSEOVER, getTestElemLocator());
}
-
+
public void testOnMouseUp() {
testFireEvent(Event.MOUSEUP, getTestElemLocator());
}
-
}
Modified: modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richMessage/RichMessageAttributes.java
===================================================================
--- modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richMessage/RichMessageAttributes.java 2011-05-06 18:23:48 UTC (rev 22478)
+++ modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richMessage/RichMessageAttributes.java 2011-05-06 18:27:42 UTC (rev 22479)
@@ -22,7 +22,6 @@
package org.richfaces.tests.metamer.ftest.richMessage;
/**
- *
* This should be enum for all know attributes.
* Need to implement an "retriever" method to get
* values from key such as "class" by "_class" key
@@ -31,24 +30,24 @@
* @version $Revision$
*/
public enum RichMessageAttributes {
- AJAX_RENDERED ("ajaxRendered"),
- RENDERED ("rendered"),
- DIR ("dir"),
- FOR ("for"),
- LANG ("lang"),
- TITLE ("title"),
- CLASS ("class"),
- STYLE ("style"),
- STYLE_CLASS ("styleClass"),
- ;
-
- private String value;
- RichMessageAttributes(String val){
+
+ AJAX_RENDERED("ajaxRendered"),
+ RENDERED("rendered"),
+ DIR("dir"),
+ FOR("for"),
+ LANG("lang"),
+ TITLE("title"),
+ CLASS("class"),
+ STYLE("style"),
+ STYLE_CLASS("styleClass");
+ private String value;
+
+ RichMessageAttributes(String val) {
this.value = val;
}
@Override
- public String toString() {
+ public String toString() {
return value;
- }
-}
\ No newline at end of file
+ }
+}
Modified: modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richMessage/RichMessageComponentAttributes.java
===================================================================
--- modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richMessage/RichMessageComponentAttributes.java 2011-05-06 18:23:48 UTC (rev 22478)
+++ modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richMessage/RichMessageComponentAttributes.java 2011-05-06 18:27:42 UTC (rev 22479)
@@ -30,29 +30,28 @@
* @version $Revision$
*/
public class RichMessageComponentAttributes extends AbstractComponentAttributes {
-
+
public void setRendered(Boolean rendered) {
setProperty("rendered", rendered);
}
-
+
public void setAjaxRendered(Boolean rendered) {
setProperty("ajaxRendered", rendered);
}
-
- public void setShowDetail(Boolean showDetail){
+
+ public void setShowDetail(Boolean showDetail) {
setProperty("showDetail", showDetail);
}
-
- public void setShowSummary(Boolean showSummary){
+
+ public void setShowSummary(Boolean showSummary) {
setProperty("showSummary", showSummary);
}
-
- public void setFor(String forAttribute){
+
+ public void setFor(String forAttribute) {
setProperty("for", forAttribute);
}
-
- public void setGlobalOnly(Boolean globalOnly){
+
+ public void setGlobalOnly(Boolean globalOnly) {
setProperty("globalOnly", globalOnly);
}
-
}
Modified: modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richMessage/RichMessageTest.java
===================================================================
--- modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richMessage/RichMessageTest.java 2011-05-06 18:23:48 UTC (rev 22478)
+++ modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richMessage/RichMessageTest.java 2011-05-06 18:27:42 UTC (rev 22479)
@@ -25,7 +25,6 @@
import org.jboss.test.selenium.locator.JQueryLocator;
-
/**
* Abstract class with list of tests appropriate for rich:message component
*
@@ -33,31 +32,29 @@
* @version $Revision$
*/
public abstract class RichMessageTest extends AbstractRichMessageTest {
-
+
// locator for main rich:message component (tested element)
protected static JQueryLocator mainMessage = pjq("span[id$=simpleInputMsg]");
-
protected JQueryLocator summary = getTestElemLocator().getDescendant(jq("span.rf-msg-sum"));
protected JQueryLocator detail = getTestElemLocator().getDescendant(jq("span.rf-msg-det"));
-
+
/**
* Attribute 'for' change behavior: only messages bound to element with
* id specified in 'for' should be displayed
*/
public void testFor() {
-
+
// firstly, remove value from attribute for and generate message
attributes.setFor("");
-
- generateValidationMessages(false);
+
+ generateValidationMessages(false);
// assertFalse(selenium.isElementPresent(getTestElemLocator()));
waitGui.until(isNotDisplayed.locator(getTestElemLocator()));
-
+
// now set for attribute back to "simpleInput2"
attributes.setFor("simpleInput2");
-
+
generateValidationMessages(false);
waitGui.until(elementPresent.locator(getTestElemLocator()));
}
-
}
Modified: modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richMessage/TestRichMessageCSV.java
===================================================================
--- modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richMessage/TestRichMessageCSV.java 2011-05-06 18:23:48 UTC (rev 22478)
+++ modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richMessage/TestRichMessageCSV.java 2011-05-06 18:27:42 UTC (rev 22479)
@@ -25,7 +25,6 @@
import java.net.URL;
-import org.jboss.test.selenium.dom.Event;
import org.jboss.test.selenium.locator.JQueryLocator;
import org.testng.annotations.Test;
@@ -36,7 +35,7 @@
* @version $Revision$
*/
public class TestRichMessageCSV extends RichMessageTest {
-
+
@Override
public URL getTestUrl() {
return buildUrl(contextPath, "faces/components/richMessage/csv.xhtml");
@@ -56,104 +55,103 @@
public JQueryLocator getDetailElemLocator() {
return detail;
}
-
+
// list of called test methods
-
@Test
- public void testFor(){
+ public void testFor() {
super.testFor();
}
-
+
@Test
public void testAjaxRendered() {
super.testAjaxRendered();
}
-
+
@Test
public void testRendered() {
super.testRendered();
}
-
+
@Test
- public void testShowSummary(){
- super.testShowSummary();
+ public void testShowSummary() {
+ super.testShowSummary();
}
-
+
@Test
- public void testShowDetail(){
+ public void testShowDetail() {
super.testShowDetail();
}
-
+
@Test
- public void testTitle(){
+ public void testTitle() {
super.testTitle();
}
-
+
@Test
- public void testDir(){
+ public void testDir() {
super.testDir();
}
-
+
@Test
- public void testLang(){
+ public void testLang() {
super.testLang();
}
-
+
@Test
- public void testStyle(){
+ public void testStyle() {
super.testStyle();
}
-
+
@Test
- public void testStyleClass(){
+ public void testStyleClass() {
super.testStyleClass();
}
-
+
@Test
public void testOnClick() {
super.testOnClick();
}
-
+
@Test
public void testOnDblClick() {
super.testOnDblClick();
}
-
+
@Test
public void testOnKeyDown() {
super.testOnKeyDown();
}
-
+
@Test
public void testOnKeyPress() {
super.testOnKeyPress();
}
-
+
@Test
public void testOnKeyUp() {
super.testOnKeyUp();
}
-
+
@Test
public void testOnMouseDown() {
super.testOnMouseDown();
}
-
+
@Test
public void testOnMouseMove() {
super.testOnMouseMove();
}
-
+
@Test
public void testOnMouseOut() {
super.testOnMouseOut();
}
-
+
@Test
public void testOnMouseOver() {
super.testOnMouseOver();
}
-
+
@Test
public void testOnMouseUp() {
super.testOnMouseUp();
Modified: modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richMessage/TestRichMessageJSFValidator.java
===================================================================
--- modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richMessage/TestRichMessageJSFValidator.java 2011-05-06 18:23:48 UTC (rev 22478)
+++ modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richMessage/TestRichMessageJSFValidator.java 2011-05-06 18:27:42 UTC (rev 22479)
@@ -43,7 +43,7 @@
public URL getTestUrl() {
return buildUrl(contextPath, "faces/components/richMessage/jsfValidator.xhtml");
}
-
+
@Override
public JQueryLocator getTestElemLocator() {
return mainMessage;
@@ -58,107 +58,105 @@
public JQueryLocator getDetailElemLocator() {
return detail;
}
-
+
// list of called test methods
-
@Test
- public void testFor(){
+ public void testFor() {
super.testFor();
}
-
+
@Test
public void testAjaxRendered() {
super.testAjaxRendered();
}
-
+
@Test
public void testRendered() {
super.testRendered();
}
-
+
@Test
- public void testShowSummary(){
- super.testShowSummary();
+ public void testShowSummary() {
+ super.testShowSummary();
}
-
+
@Test
- public void testShowDetail(){
+ public void testShowDetail() {
super.testShowDetail();
}
-
+
@Test
- public void testTitle(){
+ public void testTitle() {
super.testTitle();
}
-
+
@Test
- public void testDir(){
+ public void testDir() {
super.testDir();
}
-
+
@Test
- public void testLang(){
+ public void testLang() {
super.testLang();
}
-
+
@Test
- public void testStyle(){
+ public void testStyle() {
super.testStyle();
}
-
+
@Test
- public void testStyleClass(){
+ public void testStyleClass() {
super.testStyleClass();
}
-
+
@Test
public void testOnClick() {
super.testOnClick();
}
-
+
@Test
public void testOnDblClick() {
super.testOnDblClick();
}
-
+
@Test
public void testOnKeyDown() {
super.testOnKeyDown();
}
-
+
@Test
public void testOnKeyPress() {
super.testOnKeyPress();
}
-
+
@Test
public void testOnKeyUp() {
super.testOnKeyUp();
}
-
+
@Test
public void testOnMouseDown() {
super.testOnMouseDown();
}
-
+
@Test
public void testOnMouseMove() {
super.testOnMouseMove();
}
-
+
@Test
public void testOnMouseOut() {
super.testOnMouseOut();
}
-
+
@Test
public void testOnMouseOver() {
super.testOnMouseOver();
}
-
+
@Test
public void testOnMouseUp() {
super.testOnMouseUp();
}
-
}
Modified: modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richMessage/TestRichMessageJSR303.java
===================================================================
--- modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richMessage/TestRichMessageJSR303.java 2011-05-06 18:23:48 UTC (rev 22478)
+++ modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richMessage/TestRichMessageJSR303.java 2011-05-06 18:27:42 UTC (rev 22479)
@@ -58,107 +58,105 @@
public JQueryLocator getDetailElemLocator() {
return detail;
}
-
+
// list of called test methods
-
@Test
- public void testFor(){
+ public void testFor() {
super.testFor();
}
-
+
@Test
public void testAjaxRendered() {
super.testAjaxRendered();
}
-
+
@Test
public void testRendered() {
super.testRendered();
}
-
+
@Test
- public void testShowSummary(){
- super.testShowSummary();
+ public void testShowSummary() {
+ super.testShowSummary();
}
-
+
@Test
- public void testShowDetail(){
+ public void testShowDetail() {
super.testShowDetail();
}
-
+
@Test
- public void testTitle(){
+ public void testTitle() {
super.testTitle();
}
-
+
@Test
- public void testDir(){
+ public void testDir() {
super.testDir();
}
-
+
@Test
- public void testLang(){
+ public void testLang() {
super.testLang();
}
-
+
@Test
- public void testStyle(){
+ public void testStyle() {
super.testStyle();
}
-
+
@Test
- public void testStyleClass(){
+ public void testStyleClass() {
super.testStyleClass();
}
-
+
@Test
public void testOnClick() {
super.testOnClick();
}
-
+
@Test
public void testOnDblClick() {
super.testOnDblClick();
}
-
+
@Test
public void testOnKeyDown() {
super.testOnKeyDown();
}
-
+
@Test
public void testOnKeyPress() {
super.testOnKeyPress();
}
-
+
@Test
public void testOnKeyUp() {
super.testOnKeyUp();
}
-
+
@Test
public void testOnMouseDown() {
super.testOnMouseDown();
}
-
+
@Test
public void testOnMouseMove() {
super.testOnMouseMove();
}
-
+
@Test
public void testOnMouseOut() {
super.testOnMouseOut();
}
-
+
@Test
public void testOnMouseOver() {
super.testOnMouseOver();
}
-
+
@Test
public void testOnMouseUp() {
super.testOnMouseUp();
}
-
}
Modified: modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richMessages/RichMessagesTest.java
===================================================================
--- modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richMessages/RichMessagesTest.java 2011-05-06 18:23:48 UTC (rev 22478)
+++ modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richMessages/RichMessagesTest.java 2011-05-06 18:27:42 UTC (rev 22479)
@@ -25,9 +25,7 @@
import org.jboss.test.selenium.locator.JQueryLocator;
import org.richfaces.tests.metamer.ftest.richMessage.AbstractRichMessageTest;
-import org.testng.annotations.Test;
-
/**
* Abstract class with list of tests appropriate for rich:messages component
*
@@ -35,48 +33,49 @@
* @version $Revision$
*/
public abstract class RichMessagesTest extends AbstractRichMessageTest {
-
+
// locator for main rich:message component (tested element)
protected static JQueryLocator mainMsg1 = pjq("span[id$=msgs1]");
protected static JQueryLocator mainMsg2 = pjq("span[id$=msgs2]");
-
- // locators for
+ // locators for summary and detail in container
protected JQueryLocator summary = getTestElemLocator().getDescendant(jq("span.rf-msgs-sum"));
protected JQueryLocator detail = getTestElemLocator().getDescendant(jq("span.rf-msgs-det"));
-
protected JQueryLocator generateMsgsBtn = pjq("input[id$=generateMsgsBtn]");
-
+
// Methods for error and warning message locators
private JQueryLocator getErrorMsg(JQueryLocator testElem) {
return testElem.getDescendant(jq("span.rf-msgs-err"));
- }
+ }
+
private JQueryLocator getWarnMsg(JQueryLocator testElem) {
- return testElem.getDescendant(jq("span.rf-msgs-wrn"));
- }
+ return testElem.getDescendant(jq("span.rf-msgs-wrn"));
+ }
+
private JQueryLocator getErrorMsg() {
return getErrorMsg(getTestElemLocator());
- }
+ }
+
private JQueryLocator getWarnMsg() {
return getWarnMsg(getTestElemLocator());
}
-
+
/**
* Attribute 'for' change behavior: only messages bound to element with
* id specified in 'for' should be displayed
*/
public void testFor() {
-
+
// firstly reset to null
attributes.setFor("");
-
+
// generate faces message by btn
selenium.click(generateMsgsBtn);
-
+
// no messages for simpleInput1 or simpleInput2 should appear
waitGui.until(countEquals.count(0).locator(getTestElemLocator().getChild(jq("span[id$=msgs1:form:simpleInput1]"))));
waitGui.until(countEquals.count(0).locator(getTestElemLocator().getChild(jq("span[id$=msgs1:form:simpleInput2]"))));
-
- attributes.setFor("simpleInput1");
+
+ attributes.setFor("simpleInput1");
// generate faces messages by btn
selenium.click(generateMsgsBtn);
// only messages for simpleInput1 should appear:
@@ -85,17 +84,17 @@
waitModel.until(countEquals.count(1).locator(getErrorMsg()));
// one type warning
waitModel.until(countEquals.count(1).locator(getWarnMsg()));
-
- attributes.setFor("simpleInput2");
+
+ attributes.setFor("simpleInput2");
// generate faces messages by btn
- selenium.click(generateMsgsBtn);
+ selenium.click(generateMsgsBtn);
// only 2 messages for simpleInput2
waitModel.until(countEquals.count(2).locator(getTestElemLocator().getChild(jq("span[id$=msgs1:form:simpleInput2]"))));
// only 2 messages should appear
waitModel.until(countEquals.count(1).locator(getErrorMsg()));
waitModel.until(countEquals.count(1).locator(getWarnMsg()));
}
-
+
/**
* globalOnly change behavior of displaying messages.
* When <b>true</b> only messages not bound to any input are displayed
@@ -109,12 +108,12 @@
public void testGlobalOnly() {
// firstly set for attribute to null
attributes.setFor("");
-
+
// then set globalOnly attribute
attributes.setGlobalOnly(Boolean.FALSE);
-
+
selenium.click(generateMsgsBtn);
-
+
// All messages should appear:
// for simpleInput1
waitModel.until(countEquals.count(2).locator(mainMsg2.getChild(jq("span[id$=:msgs2:form:simpleInput1]"))));
Modified: modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richMessages/TestRichMessagesCSV.java
===================================================================
--- modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richMessages/TestRichMessagesCSV.java 2011-05-06 18:23:48 UTC (rev 22478)
+++ modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richMessages/TestRichMessagesCSV.java 2011-05-06 18:27:42 UTC (rev 22479)
@@ -35,7 +35,7 @@
* @version $Revision$
*/
public class TestRichMessagesCSV extends RichMessagesTest {
-
+
@Override
public URL getTestUrl() {
return buildUrl(contextPath, "faces/components/richMessages/csv.xhtml");
@@ -55,112 +55,110 @@
public JQueryLocator getDetailElemLocator() {
return detail;
}
-
+
// list of called test methods
-
@Test
- public void testFor(){
+ public void testFor() {
super.testFor();
}
-
+
@Test
- public void testGlobalOnly(){
+ public void testGlobalOnly() {
super.testGlobalOnly();
}
-
+
@Test
public void testAjaxRendered() {
super.testAjaxRendered();
}
-
+
@Test
public void testRendered() {
super.testRendered();
}
-
+
@Test
- public void testShowSummary(){
- super.testShowSummary();
+ public void testShowSummary() {
+ super.testShowSummary();
}
-
+
@Test
- public void testShowDetail(){
+ public void testShowDetail() {
super.testShowDetail();
}
-
+
@Test
- public void testTitle(){
+ public void testTitle() {
super.testTitle();
}
-
+
@Test
- public void testDir(){
+ public void testDir() {
super.testDir();
}
-
+
@Test
- public void testLang(){
+ public void testLang() {
super.testLang();
}
-
+
@Test
- public void testStyle(){
+ public void testStyle() {
super.testStyle();
}
-
+
@Test
- public void testStyleClass(){
+ public void testStyleClass() {
super.testStyleClass();
}
-
+
@Test
public void testOnClick() {
super.testOnClick();
}
-
+
@Test
public void testOnDblClick() {
super.testOnDblClick();
}
-
+
@Test
public void testOnKeyDown() {
super.testOnKeyDown();
}
-
+
@Test
public void testOnKeyPress() {
super.testOnKeyPress();
}
-
+
@Test
public void testOnKeyUp() {
super.testOnKeyUp();
}
-
+
@Test
public void testOnMouseDown() {
super.testOnMouseDown();
}
-
+
@Test
public void testOnMouseMove() {
super.testOnMouseMove();
}
-
+
@Test
public void testOnMouseOut() {
super.testOnMouseOut();
}
-
+
@Test
public void testOnMouseOver() {
super.testOnMouseOver();
}
-
+
@Test
public void testOnMouseUp() {
super.testOnMouseUp();
}
-
}
Modified: modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richMessages/TestRichMessagesJSFValidator.java
===================================================================
--- modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richMessages/TestRichMessagesJSFValidator.java 2011-05-06 18:23:48 UTC (rev 22478)
+++ modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richMessages/TestRichMessagesJSFValidator.java 2011-05-06 18:27:42 UTC (rev 22479)
@@ -35,7 +35,7 @@
* @version $Revision$
*/
public class TestRichMessagesJSFValidator extends RichMessagesTest {
-
+
@Override
public URL getTestUrl() {
return buildUrl(contextPath, "faces/components/richMessages/jsfValidator.xhtml");
@@ -55,112 +55,110 @@
public JQueryLocator getDetailElemLocator() {
return detail;
}
-
+
// list of called test methods
-
@Test
- public void testFor(){
+ public void testFor() {
super.testFor();
}
-
+
@Test
- public void testGlobalOnly(){
+ public void testGlobalOnly() {
super.testGlobalOnly();
}
-
+
@Test
public void testAjaxRendered() {
super.testAjaxRendered();
}
-
+
@Test
public void testRendered() {
super.testRendered();
}
-
+
@Test
- public void testShowSummary(){
- super.testShowSummary();
+ public void testShowSummary() {
+ super.testShowSummary();
}
-
+
@Test
- public void testShowDetail(){
+ public void testShowDetail() {
super.testShowDetail();
}
-
+
@Test
- public void testTitle(){
+ public void testTitle() {
super.testTitle();
}
-
+
@Test
- public void testDir(){
+ public void testDir() {
super.testDir();
}
-
+
@Test
- public void testLang(){
+ public void testLang() {
super.testLang();
}
-
+
@Test
- public void testStyle(){
+ public void testStyle() {
super.testStyle();
}
-
+
@Test
- public void testStyleClass(){
+ public void testStyleClass() {
super.testStyleClass();
}
-
+
@Test
public void testOnClick() {
super.testOnClick();
}
-
+
@Test
public void testOnDblClick() {
super.testOnDblClick();
}
-
+
@Test
public void testOnKeyDown() {
super.testOnKeyDown();
}
-
+
@Test
public void testOnKeyPress() {
super.testOnKeyPress();
}
-
+
@Test
public void testOnKeyUp() {
super.testOnKeyUp();
}
-
+
@Test
public void testOnMouseDown() {
super.testOnMouseDown();
}
-
+
@Test
public void testOnMouseMove() {
super.testOnMouseMove();
}
-
+
@Test
public void testOnMouseOut() {
super.testOnMouseOut();
}
-
+
@Test
public void testOnMouseOver() {
super.testOnMouseOver();
}
-
+
@Test
public void testOnMouseUp() {
super.testOnMouseUp();
}
-
}
Modified: modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richMessages/TestRichMessagesJSR303.java
===================================================================
--- modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richMessages/TestRichMessagesJSR303.java 2011-05-06 18:23:48 UTC (rev 22478)
+++ modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richMessages/TestRichMessagesJSR303.java 2011-05-06 18:27:42 UTC (rev 22479)
@@ -35,7 +35,7 @@
* @version $Revision$
*/
public class TestRichMessagesJSR303 extends RichMessagesTest {
-
+
@Override
public URL getTestUrl() {
return buildUrl(contextPath, "faces/components/richMessages/jsr303.xhtml");
@@ -55,112 +55,110 @@
public JQueryLocator getDetailElemLocator() {
return detail;
}
-
+
// list of called test methods
-
@Test
- public void testFor(){
+ public void testFor() {
super.testFor();
}
-
+
@Test
- public void testGlobalOnly(){
+ public void testGlobalOnly() {
super.testGlobalOnly();
}
-
+
@Test
public void testAjaxRendered() {
super.testAjaxRendered();
}
-
+
@Test
public void testRendered() {
super.testRendered();
}
-
+
@Test
- public void testShowSummary(){
- super.testShowSummary();
+ public void testShowSummary() {
+ super.testShowSummary();
}
-
+
@Test
- public void testShowDetail(){
+ public void testShowDetail() {
super.testShowDetail();
}
-
+
@Test
- public void testTitle(){
+ public void testTitle() {
super.testTitle();
}
-
+
@Test
- public void testDir(){
+ public void testDir() {
super.testDir();
}
-
+
@Test
- public void testLang(){
+ public void testLang() {
super.testLang();
}
-
+
@Test
- public void testStyle(){
+ public void testStyle() {
super.testStyle();
}
-
+
@Test
- public void testStyleClass(){
+ public void testStyleClass() {
super.testStyleClass();
}
-
+
@Test
public void testOnClick() {
super.testOnClick();
}
-
+
@Test
public void testOnDblClick() {
super.testOnDblClick();
}
-
+
@Test
public void testOnKeyDown() {
super.testOnKeyDown();
}
-
+
@Test
public void testOnKeyPress() {
super.testOnKeyPress();
}
-
+
@Test
public void testOnKeyUp() {
super.testOnKeyUp();
}
-
+
@Test
public void testOnMouseDown() {
super.testOnMouseDown();
}
-
+
@Test
public void testOnMouseMove() {
super.testOnMouseMove();
}
-
+
@Test
public void testOnMouseOut() {
super.testOnMouseOut();
}
-
+
@Test
public void testOnMouseOver() {
super.testOnMouseOver();
}
-
+
@Test
public void testOnMouseUp() {
super.testOnMouseUp();
}
-
}
13 years, 7 months
JBoss Rich Faces SVN: r22478 - in modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest: a4jMediaOutput and 2 other directories.
by richfaces-svn-commits@lists.jboss.org
Author: ppitonak(a)redhat.com
Date: 2011-05-06 14:23:48 -0400 (Fri, 06 May 2011)
New Revision: 22478
Modified:
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/PhaseInfo.java
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/a4jMediaOutput/TestImage.java
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richInplaceInput/TestRichInplaceInput.java
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richInplaceInput/TestRichInplaceInputFAjax.java
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richInputNumberSlider/TestRichSlider.java
Log:
tests fixed
Modified: modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/PhaseInfo.java
===================================================================
--- modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/PhaseInfo.java 2011-05-06 12:51:46 UTC (rev 22477)
+++ modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/PhaseInfo.java 2011-05-06 18:23:48 UTC (rev 22478)
@@ -118,7 +118,7 @@
for (int i = 1; i <= count; i++) {
String description = selenium.getText(phasesItems.getNthChildElement(i));
- if (!description.startsWith("* ")) {
+ if (!description.startsWith("*")) {
set = new LinkedHashSet<String>();
map.put(getPhaseId(description), set);
} else {
Modified: modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/a4jMediaOutput/TestImage.java
===================================================================
--- modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/a4jMediaOutput/TestImage.java 2011-05-06 12:51:46 UTC (rev 22477)
+++ modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/a4jMediaOutput/TestImage.java 2011-05-06 18:23:48 UTC (rev 22478)
@@ -78,20 +78,20 @@
}
}
- for (int x = 151; x < 300; x++) {
+ for (int x = 150; x < 300; x++) {
for (int y = 0; y < 60; y++) {
assertEquals(bufferedImage.getRGB(x, y), Color.RED.getRGB(), "Top-right quadrant should be red [" + x + ", " + y + "].");
}
}
for (int x = 0; x < 150; x++) {
- for (int y = 61; y < 120; y++) {
+ for (int y = 60; y < 120; y++) {
assertEquals(bufferedImage.getRGB(x, y), Color.BLUE.getRGB(), "Bottom-left quadrant should be blue [" + x + ", " + y + "].");
}
}
- for (int x = 151; x < 300; x++) {
- for (int y = 61; y < 120; y++) {
+ for (int x = 150; x < 300; x++) {
+ for (int y = 60; y < 120; y++) {
assertEquals(bufferedImage.getRGB(x, y), Color.GREEN.getRGB(), "Bottom-right quadrant should be yellow [" + x + ", " + y + "].");
}
}
Modified: modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richInplaceInput/TestRichInplaceInput.java
===================================================================
--- modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richInplaceInput/TestRichInplaceInput.java 2011-05-06 12:51:46 UTC (rev 22477)
+++ modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richInplaceInput/TestRichInplaceInput.java 2011-05-06 18:23:48 UTC (rev 22478)
@@ -91,7 +91,7 @@
assertEquals(selenium.getText(output), "new value", "Output did not change.");
String listenerText = selenium.getText(jq("div#phasesPanel li:eq(3)"));
- assertEquals(listenerText, "* value changed: RichFaces 4 -> new value", "Value change listener was not invoked.");
+ assertEquals(listenerText, "*1 value changed: RichFaces 4 -> new value", "Value change listener was not invoked.");
phaseInfo.assertPhases(PhaseId.RESTORE_VIEW, PhaseId.APPLY_REQUEST_VALUES, PhaseId.PROCESS_VALIDATIONS,
PhaseId.UPDATE_MODEL_VALUES, PhaseId.INVOKE_APPLICATION, PhaseId.RENDER_RESPONSE);
Modified: modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richInplaceInput/TestRichInplaceInputFAjax.java
===================================================================
--- modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richInplaceInput/TestRichInplaceInputFAjax.java 2011-05-06 12:51:46 UTC (rev 22477)
+++ modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richInplaceInput/TestRichInplaceInputFAjax.java 2011-05-06 18:23:48 UTC (rev 22478)
@@ -73,7 +73,7 @@
assertEquals(selenium.getText(output), "new value", "Output did not change.");
String listenerText = selenium.getText(jq("div#phasesPanel li:eq(3)"));
- assertEquals(listenerText, "* value changed: RichFaces 4 -> new value", "Value change listener was not invoked.");
+ assertEquals(listenerText, "*1 value changed: RichFaces 4 -> new value", "Value change listener was not invoked.");
phaseInfo.assertPhases(PhaseId.RESTORE_VIEW, PhaseId.APPLY_REQUEST_VALUES, PhaseId.PROCESS_VALIDATIONS,
PhaseId.UPDATE_MODEL_VALUES, PhaseId.INVOKE_APPLICATION, PhaseId.RENDER_RESPONSE);
Modified: modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richInputNumberSlider/TestRichSlider.java
===================================================================
--- modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richInputNumberSlider/TestRichSlider.java 2011-05-06 12:51:46 UTC (rev 22477)
+++ modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richInputNumberSlider/TestRichSlider.java 2011-05-06 18:23:48 UTC (rev 22478)
@@ -230,7 +230,7 @@
phaseInfo.assertPhases(PhaseId.RESTORE_VIEW, PhaseId.APPLY_REQUEST_VALUES, PhaseId.PROCESS_VALIDATIONS,
PhaseId.UPDATE_MODEL_VALUES, PhaseId.INVOKE_APPLICATION, PhaseId.RENDER_RESPONSE);
- phaseInfo.assertListener(PhaseId.APPLY_REQUEST_VALUES, "value changed: 2 -> -10");
+ phaseInfo.assertListener(PhaseId.APPLY_REQUEST_VALUES, "1 value changed: 2 -> -10");
}
@Test
13 years, 7 months
JBoss Rich Faces SVN: r22477 - in trunk/ui: core/ui/src/test/java/org/richfaces/component and 1 other directories.
by richfaces-svn-commits@lists.jboss.org
Author: lfryc(a)redhat.com
Date: 2011-05-06 08:51:46 -0400 (Fri, 06 May 2011)
New Revision: 22477
Added:
trunk/ui/core/ui/src/test/java/org/richfaces/component/NestedRepeatTest.java
trunk/ui/core/ui/src/test/resources/org/richfaces/component/NestedRepeatTest.xhtml
trunk/ui/core/ui/src/test/resources/org/richfaces/component/faces-config.xml
Modified:
trunk/ui/common/ui/src/main/java/org/richfaces/component/UIDataAdaptor.java
Log:
fixed UIDataAdaptor - broken resetting childState for nested components (RF-10859)
Modified: trunk/ui/common/ui/src/main/java/org/richfaces/component/UIDataAdaptor.java
===================================================================
--- trunk/ui/common/ui/src/main/java/org/richfaces/component/UIDataAdaptor.java 2011-05-06 12:45:22 UTC (rev 22476)
+++ trunk/ui/common/ui/src/main/java/org/richfaces/component/UIDataAdaptor.java 2011-05-06 12:51:46 UTC (rev 22477)
@@ -52,7 +52,9 @@
*
* @author shura
*/
-@ListenerFor(systemEventClass = PreRenderComponentEvent.class)
+@ListenersFor({ @ListenerFor(systemEventClass = PostAddToViewEvent.class),
+ @ListenerFor(systemEventClass = PostRestoreStateEvent.class),
+ @ListenerFor(systemEventClass = PreRenderViewEvent.class) })
public abstract class UIDataAdaptor extends UIComponentBase implements NamingContainer,
UniqueIdVendor, IterationStateHolder, ComponentSystemEventListener {
@@ -796,7 +798,6 @@
}
pushComponentToEL(faces, this);
- preDecode(faces);
processDecodesChildren(faces);
this.decode(faces);
popComponentFromEL(faces);
@@ -891,17 +892,19 @@
protected void resetChildState() {
getStateHelper().remove(PropertyKeys.childState);
}
+
+ private void resetState() {
+ DataComponentsContextUtil.resetDataModelOncePerPhase(getFacesContext(), this);
- protected void preDecode(FacesContext context) {
- resetDataModel();
-
- Object savedChildState = getStateHelper().get(PropertyKeys.childState);
- // TODO - verify the check for null: savedChildState == null
- if (savedChildState == null || !isKeepSaved()) {
+ if (!isKeepSaved()) {
resetChildState();
}
}
+ protected void preDecode(FacesContext context) {
+ resetState();
+ }
+
// TODO - do we need this method?
protected void preValidate(FacesContext context) {
}
@@ -911,12 +914,7 @@
}
protected void preEncodeBegin(FacesContext context) {
- DataComponentsContextUtil.resetDataModelOncePerPhase(context, this);
-
- if (!isKeepSaved()) {
- //TODO - this also resets state for the nested iteration components - is it correct?
- resetChildState();
- }
+ resetState();
}
@Override
@@ -1417,12 +1415,21 @@
public abstract void processComponent(FacesContext context, UIComponent c, Object argument);
}
-
+
@Override
public void processEvent(ComponentSystemEvent event) throws AbortProcessingException {
super.processEvent(event);
- if (event instanceof PreRenderComponentEvent) {
+ if (event instanceof PostAddToViewEvent) {
+ getFacesContext().getViewRoot().subscribeToEvent(PreRenderViewEvent.class, this);
+ }
+
+ if (event instanceof PostRestoreStateEvent) {
+ getFacesContext().getViewRoot().subscribeToEvent(PreRenderViewEvent.class, this);
+ preDecode(getFacesContext());
+ }
+
+ if (event instanceof PreRenderViewEvent) {
preEncodeBegin(getFacesContext());
}
}
Added: trunk/ui/core/ui/src/test/java/org/richfaces/component/NestedRepeatTest.java
===================================================================
--- trunk/ui/core/ui/src/test/java/org/richfaces/component/NestedRepeatTest.java (rev 0)
+++ trunk/ui/core/ui/src/test/java/org/richfaces/component/NestedRepeatTest.java 2011-05-06 12:51:46 UTC (rev 22477)
@@ -0,0 +1,128 @@
+/*
+ * 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.component;
+
+import static org.junit.Assert.assertEquals;
+
+import java.io.File;
+import java.io.Serializable;
+import java.util.LinkedList;
+import java.util.List;
+
+import junit.framework.Assert;
+
+import org.jboss.test.faces.htmlunit.HtmlUnitEnvironment;
+import org.junit.After;
+import org.junit.Before;
+import org.junit.Test;
+
+import com.gargoylesoftware.htmlunit.html.HtmlElement;
+import com.gargoylesoftware.htmlunit.html.HtmlPage;
+
+public class NestedRepeatTest {
+
+ private HtmlUnitEnvironment environment;
+
+ @Before
+ public void setUp() throws Exception {
+ environment = new HtmlUnitEnvironment();
+ environment.withWebRoot(new File(this.getClass().getResource(".").toURI()));
+ environment.withResource("/WEB-INF/faces-config.xml", "org/richfaces/component/faces-config.xml");
+ environment.start();
+
+ environment.getServer().getSession().setAttribute("dataBean", new DataBean());
+ }
+
+ @After
+ public void tearDown() throws Exception {
+ environment.release();
+ environment = null;
+ }
+
+ @Test
+ public void testRendering() throws Exception {
+ HtmlPage page = environment.getPage("/NestedRepeatTest.jsf");
+
+
+ for (int i = 0; i < 3; i++) {
+ HtmlElement input = page.getElementById("form:outer:" + i + ":inner:0:input");
+ input.type(Integer.toString(i));
+ }
+
+ HtmlElement ajax = page.getElementById("form:ajax");
+ page = ajax.click();
+
+ for (int i = 0; i < 3; i++) {
+ HtmlElement input = page.getElementById("form:outer:" + i + ":inner:0:input");
+ assertEquals(Integer.toString(i), input.getAttribute("value"));
+ }
+ }
+
+ public static class DataBean implements Serializable {
+
+ private List<DataItem> listDataItems = new LinkedList<DataItem>() {
+ {
+ add(new DataItem());
+ add(new DataItem());
+ add(new DataItem());
+ }
+ };
+
+ public List<DataItem> getListDataItems() {
+ return listDataItems;
+ }
+
+ public void setListDataItems(List<DataItem> listDataItems) {
+ this.listDataItems = listDataItems;
+ }
+ }
+
+ public static class DataItem implements Serializable {
+ private List<Inner> list = new LinkedList<Inner>() {
+ {
+ add(new Inner());
+ }
+ };
+
+ public List<Inner> getList() {
+ return list;
+ }
+
+ public void setList(List<Inner> list) {
+ this.list = list;
+ }
+
+ }
+
+ public static class Inner implements Serializable {
+ private String status;
+
+ public String getStatus() {
+ return status;
+ }
+
+ public void setStatus(String status) {
+ this.status = status;
+ }
+ }
+
+}
Added: trunk/ui/core/ui/src/test/resources/org/richfaces/component/NestedRepeatTest.xhtml
===================================================================
--- trunk/ui/core/ui/src/test/resources/org/richfaces/component/NestedRepeatTest.xhtml (rev 0)
+++ trunk/ui/core/ui/src/test/resources/org/richfaces/component/NestedRepeatTest.xhtml 2011-05-06 12:51:46 UTC (rev 22477)
@@ -0,0 +1,31 @@
+<!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">
+<f:view contentType="text/html" />
+
+<h:head>
+ <title>Richfaces Calendar</title>
+</h:head>
+
+<h:body>
+ <h:form id="form">
+ <h:messages/>
+
+
+ <a4j:repeat id="outer" value="#{dataBean.listDataItems}" var="item">
+ <a4j:repeat id="inner" value="#{item.list}" var="inner">
+ <h:inputText id="input" value="#{inner.status}" />
+ </a4j:repeat>
+ <br/>
+ </a4j:repeat>
+
+ <h:commandLink id="regular" value="Regular submit" />
+ <br/>
+ <a4j:commandLink id="ajax" value="Ajax submit" render="form" />
+
+ </h:form>
+</h:body>
+</html>
Added: trunk/ui/core/ui/src/test/resources/org/richfaces/component/faces-config.xml
===================================================================
--- trunk/ui/core/ui/src/test/resources/org/richfaces/component/faces-config.xml (rev 0)
+++ trunk/ui/core/ui/src/test/resources/org/richfaces/component/faces-config.xml 2011-05-06 12:51:46 UTC (rev 22477)
@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<faces-config xmlns="http://java.sun.com/xml/ns/javaee"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-facesconfig_2_0.xsd"
+ version="2.0">
+
+</faces-config>
\ No newline at end of file
13 years, 7 months