Author: jjamrich
Date: 2011-07-18 18:51:51 -0400 (Mon, 18 Jul 2011)
New Revision: 22553
Added:
modules/tests/metamer/trunk/application/metamer/
modules/tests/metamer/trunk/application/metamer/META-INF/
modules/tests/metamer/trunk/application/metamer/META-INF/MANIFEST.MF
modules/tests/metamer/trunk/application/src/main/webapp/components/richValidator/wrapping.xhtml
Modified:
modules/tests/metamer/trunk/application/src/main/webapp/components/richValidator/list.xhtml
Log:
RFPL-1468: add components wrapped by rich:validator
Added: modules/tests/metamer/trunk/application/metamer/META-INF/MANIFEST.MF
===================================================================
--- modules/tests/metamer/trunk/application/metamer/META-INF/MANIFEST.MF
(rev 0)
+++ modules/tests/metamer/trunk/application/metamer/META-INF/MANIFEST.MF 2011-07-18
22:51:51 UTC (rev 22553)
@@ -0,0 +1,3 @@
+Manifest-Version: 1.0
+Class-Path:
+
Modified:
modules/tests/metamer/trunk/application/src/main/webapp/components/richValidator/list.xhtml
===================================================================
---
modules/tests/metamer/trunk/application/src/main/webapp/components/richValidator/list.xhtml 2011-07-18
11:31:15 UTC (rev 22552)
+++
modules/tests/metamer/trunk/application/src/main/webapp/components/richValidator/list.xhtml 2011-07-18
22:51:51 UTC (rev 22553)
@@ -38,6 +38,10 @@
<metamer:testPageLink id="jsr303" outcome="jsr303"
value="JSR-303 Bean Validation">
Page containing input with various JSR-303 validators.
</metamer:testPageLink>
+
+ <metamer:testPageLink id="wrapping" outcome="wrapping"
value="Client side validation for many inputs wrapped by rich:validator">
+ Simple page that contains many inputs within
<b>rich:validator</b>
+ </metamer:testPageLink>
</ui:define>
Added:
modules/tests/metamer/trunk/application/src/main/webapp/components/richValidator/wrapping.xhtml
===================================================================
---
modules/tests/metamer/trunk/application/src/main/webapp/components/richValidator/wrapping.xhtml
(rev 0)
+++
modules/tests/metamer/trunk/application/src/main/webapp/components/richValidator/wrapping.xhtml 2011-07-18
22:51:51 UTC (rev 22553)
@@ -0,0 +1,221 @@
+<?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() {
+ var today = new Date();
+ var inPast = new Date(today.getTime() - 4 * 24 * 3600 * 1000);
+ var inFuture = new Date(today.getTime() + 4 * 24 * 3600 * 1000);
+
+ $('input[id$=assertTrue]')[0].checked = true;
+ $('input[id$=assertFalse]')[0].checked = false;
+ $('input[id$=decimalMinMax]').val('3');
+ $('input[id$=digits]').val('2.567');
+ $('input[id$=max]').val('9');
+ $('input[id$=min]').val('4');
+ $('input[id$=minMax]').val('4');
+ $('input[id$=notEmpty]').val('RichFaces 4');
+ $('input[id$=notNull]').val('RichFaces 4');
+ $('input[id$=pattern]').val('richFaces 4');
+ $('input[id$=regexp]').val('100');
+ $('input[id$=custom]').val('RichFaces');
+ $('input[id$=past]').val(inPast.format("d mmm yyyy"));
+ $('input[id$=future]').val(inFuture.format("d mmm
yyyy"));
+ $('input[id$=stringSize]').val('JSF');
+ $('input[value=A]')[0].checked=true
+ $('input[value=B]')[0].checked=true
+ $('input[value=C]')[0].checked=false
+ $('input[value=D]')[0].checked=false
+ $('input[value=E]')[0].checked=false
+ $('input[value=F]')[0].checked=false
+ }
+
+ function setWrongValues() {
+ var today = new Date();
+ var inPast = new Date(today.getTime() - 4 * 24 * 3600 * 1000);
+ var inFuture = new Date(today.getTime() + 4 * 24 * 3600 * 1000);
+
+ $('input[id$=assertTrue]')[0].checked = false;
+ $('input[id$=assertFalse]')[0].checked = true;
+ $('input[id$=decimalMinMax]').val('10.668');
+ $('input[id$=digits]').val('15.627123');
+ $('input[id$=max]').val('122');
+ $('input[id$=min]').val('-544');
+ $('input[id$=minMax]').val('-5');
+ $('input[id$=notEmpty]').val('');
+ $('input[id$=notNull]').val('');
+ $('input[id$=pattern]').val('@@@');
+ $('input[id$=regexp]').val('@@@');
+ $('input[id$=custom]').val('@@@');
+ $('input[id$=past]').val(inFuture.format("d mmm
yyyy"));
+ $('input[id$=future]').val(inPast.format("d mmm
yyyy"));
+ $('input[id$=stringSize]').val('JSF 2');
+ $('input[value=A]')[0].checked=false
+ $('input[value=B]')[0].checked=false
+ $('input[value=C]')[0].checked=false
+ $('input[value=D]')[0].checked=false
+ $('input[value=E]')[0].checked=false
+ $('input[value=F]')[0].checked=true
+ }
+ </script>
+
+ <input id="setCorrectValuesButton" type="button"
value="set correct values" onclick="setCorrectValues()"/>
+ <input id="setWrongValuesButton" type="button"
value="set wrong values" onclick="setWrongValues()"/>
+
+ <h:panelGrid columns="3">
+
+ <rich:validator
data="#{richValidatorBean.attributes['data'].value}"
+
disabled="#{richValidatorBean.attributes['disabled'].value}"
+
immediate="#{richValidatorBean.attributes['immediate'].value}"
+
onbeforedomupdate="#{richValidatorBean.attributes['onbeforedomupdate'].value}"
+
onbeforesubmit="#{richValidatorBean.attributes['onbeforesubmit'].value}"
+
onbegin="#{richValidatorBean.attributes['onbegin'].value}"
+
oncomplete="#{richValidatorBean.attributes['oncomplete'].value}"
+
onerror="#{richValidatorBean.attributes['onerror'].value}"
+
queueId="#{richValidatorBean.attributes['queueId'].value}"
+
status="#{richValidatorBean.attributes['status'].value}"
+ >
+
+ <h:outputLabel for="assertTrue"
value="#{assertTrueBean.description}" />
+ <h:selectBooleanCheckbox id="assertTrue"
value="#{assertTrueBean.value}" label="#{assertTrueBean.label}" />
+ <rich:message id="assertTrueMsg" for="assertTrue"
/>
+
+ <h:outputLabel for="assertFalse"
value="#{assertFalseBean.description}" />
+ <h:selectBooleanCheckbox id="assertFalse"
value="#{assertFalseBean.value}" label="#{assertFalseBean.label}"
/>
+ <rich:message id="assertFalseMsg"
for="assertFalse" />
+
+ <h:outputLabel for="decimalMinMax"
value="#{decimalMinMaxBean.description}" />
+ <h:inputText id="decimalMinMax"
value="#{decimalMinMaxBean.value}" label="#{decimalMinMaxBean.label}"
converter="#{decimalMinMaxBean.converter}" />
+ <rich:message id="decimalMinMaxMsg"
for="decimalMinMax" />
+
+ <h:outputLabel for="digits"
value="#{digitsBean.description}" />
+ <h:inputText id="digits"
value="#{digitsBean.value}" label="#{digitsBean.label}"
converter="#{digitsBean.converter}" />
+ <rich:message id="digitsMsg" for="digits" />
+
+ <h:outputLabel for="max"
value="#{maxBean.description}" />
+ <h:inputText id="max" value="#{maxBean.value}"
label="#{maxBean.label}" converter="#{maxBean.converter}" />
+ <rich:message id="maxMsg" for="max" />
+
+ <h:outputLabel for="min"
value="#{minBean.description}" />
+ <h:inputText id="min" value="#{minBean.value}"
label="#{minBean.label}" converter="#{minBean.converter}" />
+ <rich:message id="minMsg" for="min" />
+
+ <h:outputLabel for="minMax"
value="#{minMaxBean.description}" />
+ <h:inputText id="minMax"
value="#{minMaxBean.value}" label="#{minMaxBean.label}"
converter="#{minMaxBean.converter}" />
+ <rich:message id="minMaxMsg" for="minMax" />
+
+ <h:outputLabel for="notEmpty"
value="#{notEmptyBean.description}" />
+ <h:inputText id="notEmpty"
value="#{notEmptyBean.value}" label="#{notEmptyBean.label}"
converter="#{notEmptyBean.converter}" />
+ <rich:message id="notEmptyMsg" for="notEmpty"
/>
+
+ <h:outputLabel for="notNull"
value="#{notNullBean.description}" />
+ <h:inputText id="notNull"
value="#{notNullBean.value}" label="#{notNullBean.label}"
converter="emptyStringToNullConverter" />
+ <rich:message id="notNullMsg" for="notNull"
/>
+
+ <h:outputLabel for="pattern"
value="#{patternBean.description}" />
+ <h:inputText id="pattern"
value="#{patternBean.value}" label="#{patternBean.label}"
converter="#{patternBean.converter}" />
+ <rich:message id="patternMsg" for="pattern"
/>
+
+ <h:outputLabel for="custom" value="custom validator,
RichFaces" />
+ <h:inputText id="custom"
value="#{richValidatorBean.stringValue}" label="custom">
+ <f:validator
validatorId="org.richfaces.StringRichFacesValidator"/>
+ </h:inputText>
+ <rich:message id="customMsg" for="custom" />
+
+ <h:outputLabel for="regexp" value="custom regexp
validator (pattern: #{richValidatorBean.regExp})" />
+ <h:inputText id="regexp"
value="#{richValidatorBean.regexpValue}" label="custom">
+ <f:validateRegex pattern="#{richValidatorBean.regExp}"
/>
+ </h:inputText>
+ <rich:message id="regexpMsg" for="regexp" />
+
+ <h:outputLabel for="past"
value="#{pastBean.description}" />
+ <h:inputText id="past" value="#{pastBean.value}"
label="#{pastBean.label}" >
+ <f:convertDateTime pattern="d MMM yyyy"/>
+ </h:inputText>
+ <rich:message id="pastMsg" for="past" />
+
+ <h:outputLabel for="future"
value="#{futureBean.description}" />
+ <h:inputText id="future"
value="#{futureBean.value}" label="#{futureBean.label}" >
+ <f:convertDateTime pattern="d MMM yyyy"/>
+ </h:inputText>
+ <rich:message id="futureMsg" for="future" />
+
+ <h:outputLabel for="stringSize"
value="#{stringSizeBean.description}" />
+ <h:inputText id="stringSize"
value="#{stringSizeBean.value}" label="#{stringSizeBean.label}" />
+ <rich:message id="stringSizeMsg" for="stringSize"
/>
+
+ <h:outputLabel for="size"
value="#{sizeBean.description}" />
+ <h:selectManyCheckbox id="size"
value="#{sizeBean.value}" label="#{sizeBean.label}" >
+ <f:selectItem itemValue="A"
itemLabel="A"/>
+ <f:selectItem itemValue="B"
itemLabel="B"/>
+ <f:selectItem itemValue="C"
itemLabel="C"/>
+ <f:selectItem itemValue="D"
itemLabel="D"/>
+ <f:selectItem itemValue="E"
itemLabel="E"/>
+ <f:selectItem itemValue="F"
itemLabel="F"/>
+ </h:selectManyCheckbox>
+ <rich:message id="sizeMsg" for="size" />
+
+ </rich:validator>
+
+ </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>
+
+ <ui:define name="outOfTemplateAfter">
+ <metamer:attributes value="#{richValidatorBean.attributes}"
id="attributes"/>
+ </ui:define>
+
+ </ui:composition>
+</html>
\ No newline at end of file