Author: SeanRogers
Date: 2009-12-22 19:46:27 -0500 (Tue, 22 Dec 2009)
New Revision: 16192
Added:
root/docs/trunk/Component_Reference/en-US/extras/exam-Component_Reference-ValidationBean.js
root/docs/trunk/Component_Reference/en-US/extras/exam-Component_Reference-richbeanValidator-richbeanValidator_example-0.xml_sample
root/docs/trunk/Component_Reference/en-US/extras/exam-Component_Reference-richgraphValidator-richgraphValidator_example-0.xml_sample
Removed:
root/docs/trunk/Component_Reference/en-US/extras/exam-Component_Reference-richajaxValidator-Using_richajaxValidator_with_Hibernate_Validator-1.js
Log:
Adding examples
Copied:
root/docs/trunk/Component_Reference/en-US/extras/exam-Component_Reference-ValidationBean.js
(from rev 16187,
root/docs/trunk/Component_Reference/en-US/extras/exam-Component_Reference-richajaxValidator-Using_richajaxValidator_with_Hibernate_Validator-1.js)
===================================================================
---
root/docs/trunk/Component_Reference/en-US/extras/exam-Component_Reference-ValidationBean.js
(rev 0)
+++
root/docs/trunk/Component_Reference/en-US/extras/exam-Component_Reference-ValidationBean.js 2009-12-23
00:46:27 UTC (rev 16192)
@@ -0,0 +1,65 @@
+package org.richfaces.demo.validation;
+
+import org.hibernate.validator.Email;
+import org.hibernate.validator.Length;
+import org.hibernate.validator.Max;
+import org.hibernate.validator.Min;
+import org.hibernate.validator.NotEmpty;
+import org.hibernate.validator.NotNull;
+import org.hibernate.validator.Pattern;
+
+public class ValidationBean {
+
+ private String progressString="Fill the form in";
+
+ @NotEmpty
+ @Pattern(regex=".*[^\\s].*", message="This string contains only
spaces")
+ @Length(min=3,max=12)
+ private String name;
+ @Email
+ @NotEmpty
+ private String email;
+
+ @NotNull
+ @Min(18)
+ @Max(100)
+ private Integer age;
+
+ public ValidationBean() {
+ }
+
+ public String getName() {
+ return name;
+ }
+
+ public void setName(String name) {
+ this.name = name;
+ }
+
+ public String getEmail() {
+ return email;
+ }
+
+ public void setEmail(String email) {
+ this.email = email;
+ }
+
+ public Integer getAge() {
+ return age;
+ }
+
+ public void setAge(Integer age) {
+ this.age = age;
+ }
+ public void success() {
+ setProgressString(getProgressString() + "(Stored successfully)");
+ }
+
+ public String getProgressString() {
+ return progressString;
+ }
+
+ public void setProgressString(String progressString) {
+ this.progressString = progressString;
+ }
+}
Deleted:
root/docs/trunk/Component_Reference/en-US/extras/exam-Component_Reference-richajaxValidator-Using_richajaxValidator_with_Hibernate_Validator-1.js
===================================================================
---
root/docs/trunk/Component_Reference/en-US/extras/exam-Component_Reference-richajaxValidator-Using_richajaxValidator_with_Hibernate_Validator-1.js 2009-12-23
00:09:13 UTC (rev 16191)
+++
root/docs/trunk/Component_Reference/en-US/extras/exam-Component_Reference-richajaxValidator-Using_richajaxValidator_with_Hibernate_Validator-1.js 2009-12-23
00:46:27 UTC (rev 16192)
@@ -1,65 +0,0 @@
-package org.richfaces.demo.validation;
-
-import org.hibernate.validator.Email;
-import org.hibernate.validator.Length;
-import org.hibernate.validator.Max;
-import org.hibernate.validator.Min;
-import org.hibernate.validator.NotEmpty;
-import org.hibernate.validator.NotNull;
-import org.hibernate.validator.Pattern;
-
-public class ValidationBean {
-
- private String progressString="Fill the form in";
-
- @NotEmpty
- @Pattern(regex=".*[^\\s].*", message="This string contains only
spaces")
- @Length(min=3,max=12)
- private String name;
- @Email
- @NotEmpty
- private String email;
-
- @NotNull
- @Min(18)
- @Max(100)
- private Integer age;
-
- public ValidationBean() {
- }
-
- public String getName() {
- return name;
- }
-
- public void setName(String name) {
- this.name = name;
- }
-
- public String getEmail() {
- return email;
- }
-
- public void setEmail(String email) {
- this.email = email;
- }
-
- public Integer getAge() {
- return age;
- }
-
- public void setAge(Integer age) {
- this.age = age;
- }
- public void success() {
- setProgressString(getProgressString() + "(Stored successfully)");
- }
-
- public String getProgressString() {
- return progressString;
- }
-
- public void setProgressString(String progressString) {
- this.progressString = progressString;
- }
-}
Added:
root/docs/trunk/Component_Reference/en-US/extras/exam-Component_Reference-richbeanValidator-richbeanValidator_example-0.xml_sample
===================================================================
---
root/docs/trunk/Component_Reference/en-US/extras/exam-Component_Reference-richbeanValidator-richbeanValidator_example-0.xml_sample
(rev 0)
+++
root/docs/trunk/Component_Reference/en-US/extras/exam-Component_Reference-richbeanValidator-richbeanValidator_example-0.xml_sample 2009-12-23
00:46:27 UTC (rev 16192)
@@ -0,0 +1,27 @@
+<h:form id="beanValidatorForm">
+ <rich:panel>
+ <f:facet name="header">
+ <h:outputText value="#{validationBean.progressString}"
id="progress"/>
+ </f:facet>
+ <h:panelGrid columns="3">
+ <h:outputText value="Name:" />
+ <h:inputText value="#{validationBean.name}"
id="name">
+ <rich:beanValidator summary="Invalid name"/>
+ </h:inputText>
+ <rich:message for="name" />
+ <h:outputText value="Email:" />
+ <h:inputText value="#{validationBean.email}"
id="email">
+ <rich:beanValidator summary="Invalid email"/>
+ </h:inputText>
+ <rich:message for="email" />
+ <h:outputText value="Age:" />
+ <h:inputText value="#{validationBean.age}"
id="age">
+ <rich:beanValidator summary="Wrong age"/>
+ </h:inputText>
+ <rich:message for="age" />
+ <f:facet name="footer">
+ <a4j:commandButton value="Submit"
action="#{validationBean.success}" reRender="progress"/>
+ </f:facet>
+ </h:panelGrid>
+ </rich:panel>
+</h:form>
Added:
root/docs/trunk/Component_Reference/en-US/extras/exam-Component_Reference-richgraphValidator-richgraphValidator_example-0.xml_sample
===================================================================
---
root/docs/trunk/Component_Reference/en-US/extras/exam-Component_Reference-richgraphValidator-richgraphValidator_example-0.xml_sample
(rev 0)
+++
root/docs/trunk/Component_Reference/en-US/extras/exam-Component_Reference-richgraphValidator-richgraphValidator_example-0.xml_sample 2009-12-23
00:46:27 UTC (rev 16192)
@@ -0,0 +1,33 @@
+<ui:composition
xmlns="http://www.w3.org/1999/xhtml"
+
xmlns:ui="http://java.sun.com/jsf/facelets"
+
xmlns:h="http://java.sun.com/jsf/html"
+
xmlns:f="http://java.sun.com/jsf/core"
+
xmlns:a4j="http://richfaces.org/a4j"
+
xmlns:rich="http://richfaces.org/rich">
+
+ <h:form id="graphValidatorForm">
+ <a4j:region renderRegionOnly="true">
+ <rich:panel id="panel">
+ <f:facet name="header">
+ <h:outputText value="User Info:" />
+ </f:facet>
+ <rich:graphValidator summary="Invalid values: ">
+ <h:panelGrid columns="3">
+ <h:outputText value="Name:" />
+ <h:inputText value="#{validationBean.name}"
id="name">
+ <f:validateLength minimum="2" />
+ </h:inputText>
+ <rich:message for="name" />
+ <h:outputText value="Email:" />
+ <h:inputText value="#{validationBean.email}"
id="email" />
+ <rich:message for="email" />
+ <h:outputText value="Age:" />
+ <h:inputText value="#{validationBean.age}"
id="age" />
+ <rich:message for="age" />
+ </h:panelGrid>
+ </rich:graphValidator>
+ <a4j:commandButton value="Store changes" />
+ </rich:panel>
+ </a4j:region>
+ </h:form>
+</ui:composition>