Author: ilya_shaikovsky
Date: 2011-01-26 10:32:15 -0500 (Wed, 26 Jan 2011)
New Revision: 21236
Added:
trunk/examples/richfaces-showcase/src/main/webapp/richfaces/clientValidation/jsfValidators.xhtml
trunk/examples/richfaces-showcase/src/main/webapp/richfaces/clientValidation/jsr303.xhtml
trunk/examples/richfaces-showcase/src/main/webapp/richfaces/clientValidation/samples/jsfValidators-sample.xhtml
trunk/examples/richfaces-showcase/src/main/webapp/richfaces/clientValidation/samples/jsr303-sample.xhtml
Removed:
trunk/examples/richfaces-showcase/src/main/webapp/richfaces/clientValidation/samples/simple-sample.xhtml
trunk/examples/richfaces-showcase/src/main/webapp/richfaces/clientValidation/simple.xhtml
Modified:
trunk/examples/richfaces-showcase/src/main/java/org/richfaces/demo/validation/ValidationBean.java
trunk/examples/richfaces-showcase/src/main/resources/org/richfaces/demo/data/common/navigation.xml
Log:
CSV updates
Modified:
trunk/examples/richfaces-showcase/src/main/java/org/richfaces/demo/validation/ValidationBean.java
===================================================================
---
trunk/examples/richfaces-showcase/src/main/java/org/richfaces/demo/validation/ValidationBean.java 2011-01-26
15:24:37 UTC (rev 21235)
+++
trunk/examples/richfaces-showcase/src/main/java/org/richfaces/demo/validation/ValidationBean.java 2011-01-26
15:32:15 UTC (rev 21236)
@@ -2,17 +2,37 @@
import javax.faces.bean.ManagedBean;
import javax.faces.bean.RequestScoped;
+import javax.validation.constraints.AssertTrue;
+import javax.validation.constraints.Max;
+import javax.validation.constraints.Min;
+import javax.validation.constraints.Pattern;
+import org.hibernate.validator.constraints.Length;
+
@ManagedBean
@RequestScoped
public class ValidationBean {
+ @Length(min = 3, max = 12)
private String name = null;
+ @Pattern(regexp =
"^[\\w\\-]([\\.\\w])+[\\w]+(a)([\\w\\-]+\\.)+[a-zA-Z]{2,4}$")
private String email = null;
+ @Min(value = 18)
+ @Max(value = 99)
private Integer age;
private String country;
private String jobTitle;
+ @AssertTrue
+ private boolean agreed;
+ public boolean isAgreed() {
+ return agreed;
+ }
+
+ public void setAgreed(boolean agreed) {
+ this.agreed = agreed;
+ }
+
public String getName() {
return name;
}
Modified:
trunk/examples/richfaces-showcase/src/main/resources/org/richfaces/demo/data/common/navigation.xml
===================================================================
---
trunk/examples/richfaces-showcase/src/main/resources/org/richfaces/demo/data/common/navigation.xml 2011-01-26
15:24:37 UTC (rev 21235)
+++
trunk/examples/richfaces-showcase/src/main/resources/org/richfaces/demo/data/common/navigation.xml 2011-01-26
15:32:15 UTC (rev 21236)
@@ -177,12 +177,16 @@
<demos>
<demo new="true">
<id>clientValidation</id>
- <name>Ajax/Client Validation</name>
+ <name>Client Side Validation</name>
<samples>
<sample>
- <id>simple</id>
- <name>Simple Ajax Validation</name>
+ <id>jsfValidators</id>
+ <name>Standard JSF Validators</name>
</sample>
+ <sample>
+ <id>jsr303</id>
+ <name>JSR-303 Validators</name>
+ </sample>
</samples>
</demo>
</demos>
Copied:
trunk/examples/richfaces-showcase/src/main/webapp/richfaces/clientValidation/jsfValidators.xhtml
(from rev 21226,
trunk/examples/richfaces-showcase/src/main/webapp/richfaces/clientValidation/simple.xhtml)
===================================================================
---
trunk/examples/richfaces-showcase/src/main/webapp/richfaces/clientValidation/jsfValidators.xhtml
(rev 0)
+++
trunk/examples/richfaces-showcase/src/main/webapp/richfaces/clientValidation/jsfValidators.xhtml 2011-01-26
15:32:15 UTC (rev 21236)
@@ -0,0 +1,44 @@
+<!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">
+
+<ui:composition>
+ <p><b>RichFaces Client Validation</b> feature allows you to add
+ client side validation without writing any line of JavaScript!</p>
+ <p>All the JSF validators and JSR-303 standard validators will be
+ available on client side after just <b><rich:validator/></b>
to
+ the inputs which you want to be validated at client side. If you using
+ any custom validators or some additional for example hibernate
+ validators which we not implemented in first version - Ajax fallback
+ mechanism will be used. It means that behavior will try to execute all
+ client vlidators available and then send Ajax request for unknown to
+ get results from server side.</p>
+ <p>In that sample - pay attention that no requests fired when
+ typing wrong values in first two fields. And Ajax request used to
+ validate the last one.</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 Source" />
+ <ui:param name="hideLabel" value="Hide Source" />
+ </ui:include>
+ <fieldset>
+ <legend><b>Notes:</b></legend>
+ <ul>
+ <li>Some validators still not implemented. Them will start work transparently for
you after new snapshots with implementations added</li>
+ <li>We will provide information about how to provide client validation for custom
validators soon!</li>
+ </ul>
+ </fieldset>
+ <fieldset>
+ <legend><b>What to expect additionally:</b></legend>
+ After we will complete all standard validators migration and instructions for custom
ones we plan to work on next features:
+ <ul>
+ <li>Client Validation for submit components to perform bulk form
validation.</li>
+ <li>Ways of default validation definitions without usage of
<b><rich:validator/></b> tag for every input.</li>
+ </ul>
+ </fieldset>
+</ui:composition>
+</html>
\ No newline at end of file
Added:
trunk/examples/richfaces-showcase/src/main/webapp/richfaces/clientValidation/jsr303.xhtml
===================================================================
---
trunk/examples/richfaces-showcase/src/main/webapp/richfaces/clientValidation/jsr303.xhtml
(rev 0)
+++
trunk/examples/richfaces-showcase/src/main/webapp/richfaces/clientValidation/jsr303.xhtml 2011-01-26
15:32:15 UTC (rev 21236)
@@ -0,0 +1,44 @@
+<!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">
+
+<ui:composition>
+ <p><b>RichFaces Client Validation</b> feature allows you to add
+ client side validation without writing any line of JavaScript!</p>
+ <p>All the JSF validators and JSR-303 standard validators will be
+ available on client side after just <b><rich:validator/></b>
to
+ the inputs which you want to be validated at client side. If you using
+ any custom validators or some additional for example hibernate
+ validators which we not implemented in first version - Ajax fallback
+ mechanism will be used. It means that behavior will try to execute all
+ client vlidators available and then send Ajax request for unknown to
+ get results from server side.</p>
+ <p>In that sample - pay attention that no requests fired when
+ typing wrong values in first two fields. And Ajax request used to
+ validate the last one.</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 Source" />
+ <ui:param name="hideLabel" value="Hide Source" />
+ </ui:include>
+ <fieldset>
+ <legend><b>Notes:</b></legend>
+ <ul>
+ <li>Some validators still not implemented. Them will start work transparently for
you after new snapshots with implementations added</li>
+ <li>We will provide information about how to provide client validation for custom
validators soon!</li>
+ </ul>
+ </fieldset>
+ <fieldset>
+ <legend><b>What to expect additionally:</b></legend>
+ After we will complete all standard validators migration and instructions for custom
ones we plan to work on next features:
+ <ul>
+ <li>Client Validation for submit components to perform bulk form
validation.</li>
+ <li>Ways of default validation definitions without usage of
<b><rich:validator/></b> tag for every input.</li>
+ </ul>
+ </fieldset>
+</ui:composition>
+</html>
\ No newline at end of file
Copied:
trunk/examples/richfaces-showcase/src/main/webapp/richfaces/clientValidation/samples/jsfValidators-sample.xhtml
(from rev 21226,
trunk/examples/richfaces-showcase/src/main/webapp/richfaces/clientValidation/samples/simple-sample.xhtml)
===================================================================
---
trunk/examples/richfaces-showcase/src/main/webapp/richfaces/clientValidation/samples/jsfValidators-sample.xhtml
(rev 0)
+++
trunk/examples/richfaces-showcase/src/main/webapp/richfaces/clientValidation/samples/jsfValidators-sample.xhtml 2011-01-26
15:32:15 UTC (rev 21236)
@@ -0,0 +1,43 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<ui:composition
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">
+ <h:form>
+ <rich:panel>
+ <f:facet name="header">
+ <h:panelGroup>
+ <h:outputText value="User information" />
+ <a4j:status>
+ <f:facet name="start">
+ <h:graphicImage value="/images/ai.gif"
style="height:12px;width:12px;"/>
+ </f:facet>
+ </a4j:status>
+ </h:panelGroup>
+ </f:facet>
+ <h:panelGrid columns="3">
+ <h:outputText value="Name:" />
+ <h:inputText value="#{userBean.name}" id="name">
+ <f:validateLength minimum="3" maximum="8"/>
+ <f:validateRequired />
+ <rich:validator />
+ </h:inputText>
+ <rich:message for="name" />
+ <h:outputText value="Email" />
+ <h:inputText value="#{userBean.email}" id="email"
validatorMessage="bad email">
+ <f:validateRegex
pattern="^(([a-zA-Z0-9_\-\.]+)@([a-zA-Z0-9_\-\.]+)\.([a-zA-Z]{2,5}){1,25})+([;.](([a-zA-Z0-9_\-\.]+)(a)([a-zA-Z0-9_\-\.]+)\.([a-zA-Z]{2,5}){1,25})+)*$"
></f:validateRegex>
+ <rich:validator />
+ </h:inputText>
+ <rich:message for="email" />
+ <h:outputText value="Age" />
+ <h:inputText value="#{userBean.age}" id="age">
+ <f:validateLongRange minimum="3" maximum="18"/>
+ <rich:validator />
+ </h:inputText>
+ <rich:message for="age" />
+ </h:panelGrid>
+ </rich:panel>
+ </h:form>
+</ui:composition>
\ No newline at end of file
Added:
trunk/examples/richfaces-showcase/src/main/webapp/richfaces/clientValidation/samples/jsr303-sample.xhtml
===================================================================
---
trunk/examples/richfaces-showcase/src/main/webapp/richfaces/clientValidation/samples/jsr303-sample.xhtml
(rev 0)
+++
trunk/examples/richfaces-showcase/src/main/webapp/richfaces/clientValidation/samples/jsr303-sample.xhtml 2011-01-26
15:32:15 UTC (rev 21236)
@@ -0,0 +1,44 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<ui:composition
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">
+ <h:form>
+ <rich:panel>
+ <f:facet name="header">
+ <h:panelGroup>
+ <h:outputText value="User information" />
+ <a4j:status>
+ <f:facet name="start">
+ <h:graphicImage value="/images/ai.gif"
style="height:12px;width:12px;"/>
+ </f:facet>
+ </a4j:status>
+ </h:panelGroup>
+ </f:facet>
+ <h:panelGrid columns="3">
+ <h:outputText value="Name:" />
+ <h:inputText value="#{validationBean.name}" id="name">
+ <rich:validator />
+ </h:inputText>
+ <rich:message for="name" />
+ <h:outputText value="Email" />
+ <h:inputText value="#{validationBean.email}" id="email"
validatorMessage="bad email">
+ <rich:validator />
+ </h:inputText>
+ <rich:message for="email" />
+ <h:outputText value="Age" />
+ <h:inputText value="#{validationBean.age}" id="age">
+ <rich:validator />
+ </h:inputText>
+ <rich:message for="age" />
+ <h:outputText value="I agree the terms" />
+ <h:selectBooleanCheckbox value="#{validationBean.agreed}"
id="agreed">
+ <rich:validator/>
+ </h:selectBooleanCheckbox>
+ <rich:message for="agreed" />
+ </h:panelGrid>
+ </rich:panel>
+ </h:form>
+</ui:composition>
\ No newline at end of file
Deleted:
trunk/examples/richfaces-showcase/src/main/webapp/richfaces/clientValidation/samples/simple-sample.xhtml
===================================================================
---
trunk/examples/richfaces-showcase/src/main/webapp/richfaces/clientValidation/samples/simple-sample.xhtml 2011-01-26
15:24:37 UTC (rev 21235)
+++
trunk/examples/richfaces-showcase/src/main/webapp/richfaces/clientValidation/samples/simple-sample.xhtml 2011-01-26
15:32:15 UTC (rev 21236)
@@ -1,43 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<ui:composition
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">
- <h:form>
- <rich:panel>
- <f:facet name="header">
- <h:panelGroup>
- <h:outputText value="User information" />
- <a4j:status>
- <f:facet name="start">
- <h:graphicImage value="/images/ai.gif"
style="height:12px;width:12px;"/>
- </f:facet>
- </a4j:status>
- </h:panelGroup>
- </f:facet>
- <h:panelGrid columns="3">
- <h:outputText value="Name:" />
- <h:inputText value="#{validationBean.name}" id="name">
- <f:validateLength minimum="3" maximum="8"/>
- <f:validateRequired />
- <rich:validator />
- </h:inputText>
- <rich:message for="name" />
- <h:outputText value="Email" />
- <h:inputText value="#{validationBean.email}" id="email"
validatorMessage="bad email">
- <f:validateRegex
pattern="^(([a-zA-Z0-9_\-\.]+)@([a-zA-Z0-9_\-\.]+)\.([a-zA-Z]{2,5}){1,25})+([;.](([a-zA-Z0-9_\-\.]+)(a)([a-zA-Z0-9_\-\.]+)\.([a-zA-Z]{2,5}){1,25})+)*$"
></f:validateRegex>
- <rich:validator />
- </h:inputText>
- <rich:message for="email" />
- <h:outputText value="Age" />
- <h:inputText value="#{validationBean.age}" id="age">
- <f:validateLongRange minimum="3" maximum="18"/>
- <rich:validator />
- </h:inputText>
- <rich:message for="age" />
- </h:panelGrid>
- </rich:panel>
- </h:form>
-</ui:composition>
\ No newline at end of file
Deleted:
trunk/examples/richfaces-showcase/src/main/webapp/richfaces/clientValidation/simple.xhtml
===================================================================
---
trunk/examples/richfaces-showcase/src/main/webapp/richfaces/clientValidation/simple.xhtml 2011-01-26
15:24:37 UTC (rev 21235)
+++
trunk/examples/richfaces-showcase/src/main/webapp/richfaces/clientValidation/simple.xhtml 2011-01-26
15:32:15 UTC (rev 21236)
@@ -1,44 +0,0 @@
-<!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">
-
-<ui:composition>
- <p><b>RichFaces Client Validation</b> feature allows you to add
- client side validation without writing any line of JavaScript!</p>
- <p>All the JSF validators and JSR-303 standard validators will be
- available on client side after just <b><rich:validator/></b>
to
- the inputs which you want to be validated at client side. If you using
- any custom validators or some additional for example hibernate
- validators which we not implemented in first version - Ajax fallback
- mechanism will be used. It means that behavior will try to execute all
- client vlidators available and then send Ajax request for unknown to
- get results from server side.</p>
- <p>In that sample - pay attention that no requests fired when
- typing wrong values in first two fields. And Ajax request used to
- validate the last one.</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 Source" />
- <ui:param name="hideLabel" value="Hide Source" />
- </ui:include>
- <fieldset>
- <legend><b>Notes:</b></legend>
- <ul>
- <li>Some validators still not implemented. Them will start work transparently for
you after new snapshots with implementations added</li>
- <li>We will provide information about how to provide client validation for custom
validators soon!</li>
- </ul>
- </fieldset>
- <fieldset>
- <legend><b>What to expect additionally:</b></legend>
- After we will complete all standard validators migration and instructions for custom
ones we plan to work on next features:
- <ul>
- <li>Client Validation for submit components to perform bulk form
validation.</li>
- <li>Ways of default validation definitions without usage of
<b><rich:validator/></b> tag for every input.</li>
- </ul>
- </fieldset>
-</ui:composition>
-</html>
\ No newline at end of file