Author: ilya_shaikovsky
Date: 2011-01-06 07:53:58 -0500 (Thu, 06 Jan 2011)
New Revision: 20906
Added:
trunk/examples/richfaces-showcase/src/main/java/org/richfaces/demo/validation/
trunk/examples/richfaces-showcase/src/main/java/org/richfaces/demo/validation/ValidationBean.java
trunk/examples/richfaces-showcase/src/main/webapp/richfaces/clientValidation/
trunk/examples/richfaces-showcase/src/main/webapp/richfaces/clientValidation/samples/
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/pom.xml
trunk/examples/richfaces-showcase/src/main/resources/org/richfaces/demo/data/common/navigation.xml
Log:
CSV demo
Modified: trunk/examples/richfaces-showcase/pom.xml
===================================================================
--- trunk/examples/richfaces-showcase/pom.xml 2011-01-06 12:35:57 UTC (rev 20905)
+++ trunk/examples/richfaces-showcase/pom.xml 2011-01-06 12:53:58 UTC (rev 20906)
@@ -49,7 +49,21 @@
<groupId>javax.servlet</groupId>
<artifactId>jstl</artifactId>
</dependency>
-
+ <dependency>
+ <groupId>org.hibernate</groupId>
+ <artifactId>hibernate-validator</artifactId>
+ <version>4.1.0.Final</version>
+ </dependency>
+ <dependency>
+ <groupId>javax.validation</groupId>
+ <artifactId>validation-api</artifactId>
+ <version>1.0.0.GA</version>
+ </dependency>
+ <dependency>
+ <groupId>org.slf4j</groupId>
+ <artifactId>slf4j-log4j12</artifactId>
+ <version>1.5.8</version>
+ </dependency>
<dependency>
<groupId>net.sf.ehcache</groupId>
<artifactId>ehcache</artifactId>
Added:
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
(rev 0)
+++
trunk/examples/richfaces-showcase/src/main/java/org/richfaces/demo/validation/ValidationBean.java 2011-01-06
12:53:58 UTC (rev 20906)
@@ -0,0 +1,66 @@
+package org.richfaces.demo.validation;
+
+import javax.faces.bean.ManagedBean;
+import javax.faces.bean.RequestScoped;
+import javax.validation.constraints.Min;
+
+import org.hibernate.validator.constraints.Email;
+import org.hibernate.validator.constraints.Length;
+import org.hibernate.validator.constraints.NotBlank;
+
+@ManagedBean
+@RequestScoped
+public class ValidationBean {
+
+ @NotBlank
+ @Length(min = 3, max = 12)
+ private String name;
+ @Email
+ @NotBlank
+ private String email;
+ @Min(value = 18)
+ private Integer age;
+ private String country;
+ private String jobTitle;
+
+ 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 String getCountry() {
+ return country;
+ }
+
+ public void setCountry(String country) {
+ this.country = country;
+ }
+
+ public String getJobTitle() {
+ return jobTitle;
+ }
+
+ public void setJobTitle(String jobTitle) {
+ this.jobTitle = jobTitle;
+ }
+
+}
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-06
12:35:57 UTC (rev 20905)
+++
trunk/examples/richfaces-showcase/src/main/resources/org/richfaces/demo/data/common/navigation.xml 2011-01-06
12:53:58 UTC (rev 20906)
@@ -172,7 +172,7 @@
</demo>
</demos>
</group>
- <!-- group>
+ <group>
<name>Validation</name>
<demos>
<demo new="true">
@@ -186,7 +186,7 @@
</samples>
</demo>
</demos>
- </group-->
+ </group>
<group>
<name>Data Iteration</name>
<demos>
Added:
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
(rev 0)
+++
trunk/examples/richfaces-showcase/src/main/webapp/richfaces/clientValidation/samples/simple-sample.xhtml 2011-01-06
12:53:58 UTC (rev 20906)
@@ -0,0 +1,30 @@
+<!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 header="User information">
+ <h:panelGrid columns="3">
+ <h:outputText value="Name:" />
+ <h:inputText value="#{validationBean.name}" id="name">
+ <f:validateLength minimum="1" maximum="3"/>
+ <rich:validator />
+ </h:inputText>
+ <rich:message for="name" />
+ <h:outputText value="Email" />
+ <h:inputText value="#{validationBean.email}" id="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:panelGrid>
+ </rich:panel>
+ </h:form>
+</ui:composition>
\ No newline at end of file
Added:
trunk/examples/richfaces-showcase/src/main/webapp/richfaces/clientValidation/simple.xhtml
===================================================================
---
trunk/examples/richfaces-showcase/src/main/webapp/richfaces/clientValidation/simple.xhtml
(rev 0)
+++
trunk/examples/richfaces-showcase/src/main/webapp/richfaces/clientValidation/simple.xhtml 2011-01-06
12:53:58 UTC (rev 20906)
@@ -0,0 +1,16 @@
+<!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>
+ <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>
+</ui:composition>
+</html>
\ No newline at end of file