Author: jjamrich
Date: 2011-05-15 21:12:26 -0400 (Sun, 15 May 2011)
New Revision: 22490
Modified:
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/rich/RichValidatorBean.java
modules/tests/metamer/trunk/application/src/main/webapp/components/richValidator/csv.xhtml
Log:
Add regExp based validator into client-side validation testing.
Modified:
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/rich/RichValidatorBean.java
===================================================================
---
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/rich/RichValidatorBean.java 2011-05-16
01:11:22 UTC (rev 22489)
+++
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/rich/RichValidatorBean.java 2011-05-16
01:12:26 UTC (rev 22490)
@@ -46,6 +46,8 @@
private static Logger logger;
private Attributes attributes;
private String stringValue = "RichFaces";
+ private String regExp = "\\d{3}";
+ private String regexpValue = "100";
/**
* Initializes the managed bean.
@@ -73,4 +75,20 @@
public void setStringValue(String stringValue) {
this.stringValue = stringValue;
}
+
+ public String getRegexpValue() {
+ return regexpValue;
+ }
+
+ public void setRegexpValue(String regexpValue) {
+ this.regexpValue = regexpValue;
+ }
+
+ public String getRegExp() {
+ return regExp;
+ }
+
+ public void setRegExp(String regExp) {
+ this.regExp = regExp;
+ }
}
Modified:
modules/tests/metamer/trunk/application/src/main/webapp/components/richValidator/csv.xhtml
===================================================================
---
modules/tests/metamer/trunk/application/src/main/webapp/components/richValidator/csv.xhtml 2011-05-16
01:11:22 UTC (rev 22489)
+++
modules/tests/metamer/trunk/application/src/main/webapp/components/richValidator/csv.xhtml 2011-05-16
01:12:26 UTC (rev 22490)
@@ -283,7 +283,24 @@
/>
</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}"
/>
+ <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: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"/>
Show replies by date