Author: alexsmirnov
Date: 2011-01-28 19:41:00 -0500 (Fri, 28 Jan 2011)
New Revision: 21312
Added:
trunk/examples/template/src/main/webapp/main.xhtml
trunk/examples/validator-demo/src/main/java/org/richfaces/example/DataBean.java
trunk/examples/validator-demo/src/main/java/org/richfaces/example/LengthBean.java
trunk/examples/validator-demo/src/main/java/org/richfaces/example/MaxBean.java
trunk/examples/validator-demo/src/main/java/org/richfaces/example/MinBean.java
trunk/examples/validator-demo/src/main/java/org/richfaces/example/MinMaxBean.java
trunk/examples/validator-demo/src/main/java/org/richfaces/example/NotEmptyBean.java
trunk/examples/validator-demo/src/main/java/org/richfaces/example/NotNullBean.java
trunk/examples/validator-demo/src/main/java/org/richfaces/example/Validable.java
trunk/examples/validator-demo/src/main/webapp/examples/beanValidation.xhtml
trunk/examples/validator-demo/src/main/webapp/examples/faces-validators.xhtml
trunk/examples/validator-demo/src/main/webapp/examples/graphValidation.xhtml
Modified:
trunk/examples/template/src/main/java/org/richfaces/example/Pages.java
trunk/examples/template/src/main/webapp/WEB-INF/web.xml
trunk/examples/template/src/main/webapp/index.jsp
trunk/examples/template/src/main/webapp/layout/template.xhtml
trunk/examples/validator-demo/src/main/java/org/richfaces/example/Bean.java
Log:
CODING IN PROGRESS - issue RF-10309: CSV: not working JSF validators.
https://issues.jboss.org/browse/RF-10309
Modified: trunk/examples/template/src/main/java/org/richfaces/example/Pages.java
===================================================================
--- trunk/examples/template/src/main/java/org/richfaces/example/Pages.java 2011-01-28
20:12:49 UTC (rev 21311)
+++ trunk/examples/template/src/main/java/org/richfaces/example/Pages.java 2011-01-29
00:41:00 UTC (rev 21312)
@@ -24,7 +24,7 @@
public class Pages {
- public static final String DEFAULT_TITLE_PATTERN =
"<h2>(.*)</h2>";
+ public static final String DEFAULT_TITLE_PATTERN =
"<ui\\:param\\s+name=\"title\"\\s+value=\"([^\"]*)\"";
private static final Pattern JSP_PATTERN = Pattern.compile(".*\\.jspx?");
@@ -32,13 +32,13 @@
private Pattern titlePattern = compilePattern(DEFAULT_TITLE_PATTERN);
- private volatile List<PageDescriptionBean> _jspPages;
+ private volatile List<PageDescriptionBean> jspPages;
private Object jspMutex = new Object();
- private String _path = "/pages";
+ private String path = "/examples";
- private volatile List<PageDescriptionBean> _xhtmlPages;
+ private volatile List<PageDescriptionBean> xhtmlPages;
private Object xhtmlMutex = new Object();
@@ -46,7 +46,7 @@
* @return the path
*/
public String getPath() {
- return _path;
+ return path;
}
public Pattern compilePattern(String titlePattern) {
@@ -59,19 +59,19 @@
* the path to set
*/
public void setPath(String path) {
- _path = path;
+ this.path = path;
}
public List<PageDescriptionBean> getJspPages() {
- if (_jspPages == null && null != getExternalContext()) {
+ if (jspPages == null && null != getExternalContext()) {
synchronized (jspMutex) {
- if (_jspPages == null) {
- _jspPages = getPagesByPattern(JSP_PATTERN);
+ if (jspPages == null) {
+ jspPages = getPagesByPattern(JSP_PATTERN);
}
}
}
- return _jspPages;
+ return jspPages;
}
private ExternalContext getExternalContext() {
@@ -85,15 +85,15 @@
}
public List<PageDescriptionBean> getXhtmlPages() {
- if (_xhtmlPages == null && null != getExternalContext()) {
+ if (xhtmlPages == null && null != getExternalContext()) {
synchronized (xhtmlMutex) {
- if (_xhtmlPages == null) {
- _xhtmlPages = getPagesByPattern(XHTML_PATTERN);
+ if (xhtmlPages == null) {
+ xhtmlPages = getPagesByPattern(XHTML_PATTERN);
}
}
}
- return _xhtmlPages;
+ return xhtmlPages;
}
/**
Modified: trunk/examples/template/src/main/webapp/WEB-INF/web.xml
===================================================================
--- trunk/examples/template/src/main/webapp/WEB-INF/web.xml 2011-01-28 20:12:49 UTC (rev
21311)
+++ trunk/examples/template/src/main/webapp/WEB-INF/web.xml 2011-01-29 00:41:00 UTC (rev
21312)
@@ -25,10 +25,6 @@
<param-name>javax.faces.DEFAULT_SUFFIX</param-name>
<param-value>.xhtml</param-value>
</context-param>
- <context-param>
- <param-name>facelets.DEVELOPMENT</param-name>
- <param-value>true</param-value>
- </context-param>
<!-- Faces Servlet -->
<servlet>
@@ -48,7 +44,6 @@
-->
<servlet-mapping>
<servlet-name>Faces Servlet</servlet-name>
- <url-pattern>/faces/*</url-pattern>
<url-pattern>*.jsf</url-pattern>
</servlet-mapping>
<welcome-file-list>
Modified: trunk/examples/template/src/main/webapp/index.jsp
===================================================================
--- trunk/examples/template/src/main/webapp/index.jsp 2011-01-28 20:12:49 UTC (rev 21311)
+++ trunk/examples/template/src/main/webapp/index.jsp 2011-01-29 00:41:00 UTC (rev 21312)
@@ -5,7 +5,7 @@
<head></head>
<body>
- <jsp:forward page="/pages/index.jsf" />
+ <jsp:forward page="/main.jsf" />
</body>
</html>
\ No newline at end of file
Modified: trunk/examples/template/src/main/webapp/layout/template.xhtml
===================================================================
--- trunk/examples/template/src/main/webapp/layout/template.xhtml 2011-01-28 20:12:49 UTC
(rev 21311)
+++ trunk/examples/template/src/main/webapp/layout/template.xhtml 2011-01-29 00:41:00 UTC
(rev 21312)
@@ -2,27 +2,27 @@
<html
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:f="http://java.sun.com/jsf/core">
<f:view contentType="text/html">
-<h:head>
- <title>#{title}</title>
-</h:head>
-<h:body>
- <h:outputStylesheet name="reset-fonts-grids.css"
library="com.exadel.template"/>
- <div id="doc3" class="yui-t2">
- <div id="hd"><ui:insert name="header" /></div>
- <div id="bd">
- <div id="yui-main">
- <div class="yui-b">
- <div class="yui-g"><!-- YOUR DATA GOES HERE --> <ui:insert
- name="content" /></div>
- </div>
- </div>
- <div class="yui-b"><!-- YOUR NAVIGATION GOES HERE --></div>
- <ui:include src="/layout/pagesList.xhtml" /></div>
- <div id="ft">(C) Exadel Inc. 2010</div>
- </div>
-</h:body>
+ <h:head>
+ <title>#{title}</title>
+ </h:head>
+ <h:body>
+ <h:outputStylesheet name="reset-fonts-grids.css"
+ library="org.richfaces.template" />
+ <div id="doc3" class="yui-t2">
+ <div id="hd"><ui:insert name="header" /></div>
+ <div id="bd">
+ <div id="yui-main">
+ <div class="yui-b">
+ <div class="yui-g"><!-- YOUR DATA GOES HERE --> <ui:insert
+ name="content" /></div>
+ </div>
+ </div>
+ <div class="yui-b"><!-- YOUR NAVIGATION GOES HERE -->
<ui:include
+ src="/layout/pagesList.xhtml" /></div>
+ </div>
+ </div>
+ </h:body>
</f:view>
</html>
\ No newline at end of file
Added: trunk/examples/template/src/main/webapp/main.xhtml
===================================================================
--- trunk/examples/template/src/main/webapp/main.xhtml (rev 0)
+++ trunk/examples/template/src/main/webapp/main.xhtml 2011-01-29 00:41:00 UTC (rev
21312)
@@ -0,0 +1,14 @@
+<html
xmlns="http://www.w3.org/1999/xhtml"
+
xmlns:f="http://java.sun.com/jsf/core"
+
xmlns:h="http://java.sun.com/jsf/html"
+
xmlns:ui="http://java.sun.com/jsf/facelets"
+
xmlns:csv="http://richfaces.org/csv"
+
xmlns:c="http://java.sun.com/jsp/jstl/core">
+<ui:composition template="/layout/template.xhtml">
+ <ui:param name="title" value="Developer example" />
+ <!-- content -->
+ <ui:define name="content">
+ <h2>Developer example</h2>
+ </ui:define>
+</ui:composition>
+</html>
\ No newline at end of file
Property changes on: trunk/examples/template/src/main/webapp/main.xhtml
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Modified: trunk/examples/validator-demo/src/main/java/org/richfaces/example/Bean.java
===================================================================
--- trunk/examples/validator-demo/src/main/java/org/richfaces/example/Bean.java 2011-01-28
20:12:49 UTC (rev 21311)
+++ trunk/examples/validator-demo/src/main/java/org/richfaces/example/Bean.java 2011-01-29
00:41:00 UTC (rev 21312)
@@ -5,6 +5,16 @@
public static final String FOO_VALUE = "fooValue";
private String value=FOO_VALUE;
+
+ private String required;
+
+ private int intValue;
+
+ private long longValue;
+
+ private double doubleValue;
+
+ private String email;
/**
* @return the value
@@ -18,5 +28,75 @@
public void setValue(String value) {
this.value = value;
}
+ /**
+ * <p class="changed_added_4_0"></p>
+ * @return the required
+ */
+ public String getRequired() {
+ return this.required;
+ }
+ /**
+ * <p class="changed_added_4_0"></p>
+ * @param required the required to set
+ */
+ public void setRequired(String required) {
+ this.required = required;
+ }
+ /**
+ * <p class="changed_added_4_0"></p>
+ * @return the intValue
+ */
+ public int getIntValue() {
+ return this.intValue;
+ }
+ /**
+ * <p class="changed_added_4_0"></p>
+ * @param intValue the intValue to set
+ */
+ public void setIntValue(int intValue) {
+ this.intValue = intValue;
+ }
+ /**
+ * <p class="changed_added_4_0"></p>
+ * @return the longValue
+ */
+ public long getLongValue() {
+ return this.longValue;
+ }
+ /**
+ * <p class="changed_added_4_0"></p>
+ * @param longValue the longValue to set
+ */
+ public void setLongValue(long longValue) {
+ this.longValue = longValue;
+ }
+ /**
+ * <p class="changed_added_4_0"></p>
+ * @return the doubleValue
+ */
+ public double getDoubleValue() {
+ return this.doubleValue;
+ }
+ /**
+ * <p class="changed_added_4_0"></p>
+ * @param doubleValue the doubleValue to set
+ */
+ public void setDoubleValue(double doubleValue) {
+ this.doubleValue = doubleValue;
+ }
+ /**
+ * <p class="changed_added_4_0"></p>
+ * @return the email
+ */
+ public String getEmail() {
+ return this.email;
+ }
+ /**
+ * <p class="changed_added_4_0"></p>
+ * @param email the email to set
+ */
+ public void setEmail(String email) {
+ this.email = email;
+ }
}
Added: trunk/examples/validator-demo/src/main/java/org/richfaces/example/DataBean.java
===================================================================
--- trunk/examples/validator-demo/src/main/java/org/richfaces/example/DataBean.java
(rev 0)
+++
trunk/examples/validator-demo/src/main/java/org/richfaces/example/DataBean.java 2011-01-29
00:41:00 UTC (rev 21312)
@@ -0,0 +1,49 @@
+/**
+ *
+ */
+package org.richfaces.example;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import javax.validation.Valid;
+import javax.validation.constraints.Max;
+
+
+/**
+ * @author asmirnov
+ *
+ */
+public class DataBean {
+
+ private final List<Validable> beans;
+
+ /**
+ * @return the beans
+ */
+ @Valid
+ public List<Validable> getBeans() {
+ return beans;
+ }
+
+ public DataBean() {
+ beans = new ArrayList<Validable>(6);
+ beans.add(new NotNullBean());
+ beans.add(new NotEmptyBean());
+ beans.add(new LengthBean());
+ beans.add(new MinBean());
+ beans.add(new MaxBean());
+ beans.add(new MinMaxBean());
+ }
+
+ @Max(value=20,message="Total value should be less then 20")
+ public int getTotal(){
+ int total = 0;
+ for (Validable bean : beans) {
+ total += bean.getIntValue();
+ }
+ return total;
+ }
+
+
+}
Property changes on:
trunk/examples/validator-demo/src/main/java/org/richfaces/example/DataBean.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: trunk/examples/validator-demo/src/main/java/org/richfaces/example/LengthBean.java
===================================================================
--- trunk/examples/validator-demo/src/main/java/org/richfaces/example/LengthBean.java
(rev 0)
+++
trunk/examples/validator-demo/src/main/java/org/richfaces/example/LengthBean.java 2011-01-29
00:41:00 UTC (rev 21312)
@@ -0,0 +1,64 @@
+/**
+ *
+ */
+package org.richfaces.example;
+
+import org.hibernate.validator.constraints.Length;
+
+
+/**
+ * @author asmirnov
+ *
+ */
+public class LengthBean implements Validable {
+
+ @Length(max=10,min=2,message="incorrect field length")
+ private String text;
+
+ private int intValue;
+
+ /**
+ * @return the text
+ */
+ public String getText() {
+ return text;
+ }
+
+ /**
+ * @param text the text to set
+ */
+ public void setText(String text) {
+ this.text = text;
+ }
+
+ /**
+ * @return the intValue
+ */
+ public int getIntValue() {
+ return intValue;
+ }
+
+ /**
+ * @param intValue the intValue to set
+ */
+ public void setIntValue(int intValue) {
+ this.intValue = intValue;
+ }
+
+ public String getTextDescription() {
+ return "Validate String Length, for a range 2-10 chars";
+ }
+
+ public String getIntDescription() {
+ return "Integer Value, no restrictions";
+ }
+
+ public String getIntSummary() {
+ return "Invalid user name";
+ }
+
+ public String getTextSummary() {
+ return "Invalid user name";
+ }
+
+}
Property changes on:
trunk/examples/validator-demo/src/main/java/org/richfaces/example/LengthBean.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: trunk/examples/validator-demo/src/main/java/org/richfaces/example/MaxBean.java
===================================================================
--- trunk/examples/validator-demo/src/main/java/org/richfaces/example/MaxBean.java
(rev 0)
+++
trunk/examples/validator-demo/src/main/java/org/richfaces/example/MaxBean.java 2011-01-29
00:41:00 UTC (rev 21312)
@@ -0,0 +1,67 @@
+/**
+ *
+ */
+package org.richfaces.example;
+
+import javax.validation.constraints.Max;
+
+import org.hibernate.validator.constraints.Email;
+
+
+/**
+ * @author asmirnov
+ *
+ */
+public class MaxBean implements Validable {
+
+ private String text;
+
+ @Max(10)
+ private int intValue;
+
+ /**
+ * @return the text
+ */
+ @Email
+ public String getText() {
+ return text;
+ }
+
+ /**
+ * @param text the text to set
+ */
+ public void setText(String text) {
+ this.text = text;
+ }
+
+ /**
+ * @return the intValue
+ */
+ public int getIntValue() {
+ return intValue;
+ }
+
+ /**
+ * @param intValue the intValue to set
+ */
+ public void setIntValue(int intValue) {
+ this.intValue = intValue;
+ }
+
+ public String getTextDescription() {
+ return "Text value, should be correct email address";
+ }
+
+ public String getIntDescription() {
+ return "Integer Value, less then 10";
+ }
+
+ public String getIntSummary() {
+ return "Invalid number of items";
+ }
+
+ public String getTextSummary() {
+ return "Invalid payment card";
+ }
+
+}
Property changes on:
trunk/examples/validator-demo/src/main/java/org/richfaces/example/MaxBean.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: trunk/examples/validator-demo/src/main/java/org/richfaces/example/MinBean.java
===================================================================
--- trunk/examples/validator-demo/src/main/java/org/richfaces/example/MinBean.java
(rev 0)
+++
trunk/examples/validator-demo/src/main/java/org/richfaces/example/MinBean.java 2011-01-29
00:41:00 UTC (rev 21312)
@@ -0,0 +1,67 @@
+/**
+ *
+ */
+package org.richfaces.example;
+
+import javax.validation.constraints.Min;
+
+
+/**
+ * @author asmirnov
+ *
+ */
+public class MinBean implements Validable {
+
+ private String text;
+
+ @Min(2)
+ private int intValue;
+
+ /**
+ * @return the text
+ */
+ public String getText() {
+ return text;
+ }
+
+ /**
+ * @param text the text to set
+ */
+ public void setText(String text) {
+ this.text = text;
+ }
+
+ /**
+ * @return the intValue
+ */
+ public int getIntValue() {
+ return intValue;
+ }
+
+ /**
+ * @param intValue the intValue to set
+ */
+ public void setIntValue(int intValue) {
+ this.intValue = intValue;
+ }
+
+ public String getTextDescription() {
+ return "Text value, no restrictions";
+ }
+
+ public String getIntDescription() {
+ // TODO Auto-generated method stub
+ return "Integer Value, more then 1";
+ }
+
+ public String getIntSummary() {
+ // TODO Auto-generated method stub
+ return "Invalid rooms qty";
+ }
+
+ public String getTextSummary() {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+}
Property changes on:
trunk/examples/validator-demo/src/main/java/org/richfaces/example/MinBean.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: trunk/examples/validator-demo/src/main/java/org/richfaces/example/MinMaxBean.java
===================================================================
--- trunk/examples/validator-demo/src/main/java/org/richfaces/example/MinMaxBean.java
(rev 0)
+++
trunk/examples/validator-demo/src/main/java/org/richfaces/example/MinMaxBean.java 2011-01-29
00:41:00 UTC (rev 21312)
@@ -0,0 +1,69 @@
+/**
+ *
+ */
+package org.richfaces.example;
+
+import javax.validation.constraints.Max;
+import javax.validation.constraints.Min;
+
+
+/**
+ * @author asmirnov
+ *
+ */
+public class MinMaxBean implements Validable {
+
+ private String text;
+
+ @Min(2)
+ @Max(10)
+ private int intValue;
+
+ /**
+ * @return the text
+ */
+ public String getText() {
+ return text;
+ }
+
+ /**
+ * @param text the text to set
+ */
+ public void setText(String text) {
+ this.text = text;
+ }
+
+ /**
+ * @return the intValue
+ */
+ public int getIntValue() {
+ return intValue;
+ }
+
+ /**
+ * @param intValue the intValue to set
+ */
+ public void setIntValue(int intValue) {
+ this.intValue = intValue;
+ }
+
+ public String getTextDescription() {
+ return "Text Value, no restrictions";
+ }
+
+ public String getIntDescription() {
+ // TODO Auto-generated method stub
+ return "Integer Value, valid values from 2 to 10";
+ }
+
+ public String getIntSummary() {
+ // TODO Auto-generated method stub
+ return "Invalid price";
+ }
+
+ public String getTextSummary() {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+}
Property changes on:
trunk/examples/validator-demo/src/main/java/org/richfaces/example/MinMaxBean.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added:
trunk/examples/validator-demo/src/main/java/org/richfaces/example/NotEmptyBean.java
===================================================================
--- trunk/examples/validator-demo/src/main/java/org/richfaces/example/NotEmptyBean.java
(rev 0)
+++
trunk/examples/validator-demo/src/main/java/org/richfaces/example/NotEmptyBean.java 2011-01-29
00:41:00 UTC (rev 21312)
@@ -0,0 +1,67 @@
+/**
+ *
+ */
+package org.richfaces.example;
+
+import org.hibernate.validator.constraints.NotEmpty;
+
+
+/**
+ * @author asmirnov
+ *
+ */
+public class NotEmptyBean implements Validable {
+
+ @NotEmpty
+ private String text;
+
+ private int intValue;
+
+ /**
+ * @return the text
+ */
+ public String getText() {
+ return text;
+ }
+
+ /**
+ * @param text the text to set
+ */
+ public void setText(String text) {
+ this.text = text;
+ }
+
+ /**
+ * @return the intValue
+ */
+ public int getIntValue() {
+ return intValue;
+ }
+
+ /**
+ * @param intValue the intValue to set
+ */
+ public void setIntValue(int intValue) {
+ this.intValue = intValue;
+ }
+
+ public String getTextDescription() {
+ return "Text value, Not Empty Validation";
+ }
+
+ public String getIntDescription() {
+ // TODO Auto-generated method stub
+ return "Integer Value, no restrictions";
+ }
+
+ public String getIntSummary() {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ public String getTextSummary() {
+ // TODO Auto-generated method stub
+ return "Invalid password";
+ }
+
+}
Property changes on:
trunk/examples/validator-demo/src/main/java/org/richfaces/example/NotEmptyBean.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: trunk/examples/validator-demo/src/main/java/org/richfaces/example/NotNullBean.java
===================================================================
--- trunk/examples/validator-demo/src/main/java/org/richfaces/example/NotNullBean.java
(rev 0)
+++
trunk/examples/validator-demo/src/main/java/org/richfaces/example/NotNullBean.java 2011-01-29
00:41:00 UTC (rev 21312)
@@ -0,0 +1,67 @@
+/**
+ *
+ */
+package org.richfaces.example;
+
+import javax.validation.constraints.NotNull;
+
+
+/**
+ * @author asmirnov
+ *
+ */
+public class NotNullBean implements Validable {
+
+ @NotNull
+ private String text;
+
+ private int intValue;
+
+ /**
+ * @return the text
+ */
+ public String getText() {
+ return text;
+ }
+
+ /**
+ * @param text the text to set
+ */
+ public void setText(String text) {
+ this.text = text;
+ }
+
+ /**
+ * @return the intValue
+ */
+ public int getIntValue() {
+ return intValue;
+ }
+
+ /**
+ * @param intValue the intValue to set
+ */
+ public void setIntValue(int intValue) {
+ this.intValue = intValue;
+ }
+
+ public String getTextDescription() {
+ return "Text Value, Not Null Validation";
+ }
+
+ public String getIntDescription() {
+ // TODO Auto-generated method stub
+ return "Integer Value, no restrictions";
+ }
+
+ public String getIntSummary() {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ public String getTextSummary() {
+ // TODO Auto-generated method stub
+ return "Invalid address";
+ }
+
+}
Property changes on:
trunk/examples/validator-demo/src/main/java/org/richfaces/example/NotNullBean.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: trunk/examples/validator-demo/src/main/java/org/richfaces/example/Validable.java
===================================================================
--- trunk/examples/validator-demo/src/main/java/org/richfaces/example/Validable.java
(rev 0)
+++
trunk/examples/validator-demo/src/main/java/org/richfaces/example/Validable.java 2011-01-29
00:41:00 UTC (rev 21312)
@@ -0,0 +1,21 @@
+/**
+ *
+ */
+package org.richfaces.example;
+
+/**
+ * @author asmirnov
+ *
+ */
+public interface Validable {
+
+ public String getText();
+
+ public String getTextDescription();
+
+ public String getTextSummary();
+
+ public int getIntValue();
+
+ public String getIntSummary();
+}
Property changes on:
trunk/examples/validator-demo/src/main/java/org/richfaces/example/Validable.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: trunk/examples/validator-demo/src/main/webapp/examples/beanValidation.xhtml
===================================================================
--- trunk/examples/validator-demo/src/main/webapp/examples/beanValidation.xhtml
(rev 0)
+++ trunk/examples/validator-demo/src/main/webapp/examples/beanValidation.xhtml 2011-01-29
00:41:00 UTC (rev 21312)
@@ -0,0 +1,37 @@
+<!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:f="http://java.sun.com/jsf/core"
+
xmlns:h="http://java.sun.com/jsf/html"
+
xmlns:ui="http://java.sun.com/jsf/facelets"
+
xmlns:a4j="http://richfaces.org/a4j"
+
xmlns:rich="http://richfaces.org/rich"
+
xmlns:s="http://jboss.com/products/seam/taglib"
+
xmlns:c="http://java.sun.com/jsp/jstl/core">
+<ui:composition template="/layout/template.xhtml">
+ <ui:param name="title" value="<rich:beanValidator>
usage" />
+ <ui:param name="javaBean" value="org/richfaces/example/Bean.java"
/>
+ <!-- Page header -->
+ <ui:define name="header">
+ <h1><rich:beanValidator> usage</h1>
+ </ui:define>
+ <!-- content -->
+ <ui:define name="content">
+ <h:form id="form">
+ <h:panelGrid columns="3">
+ <h:outputLabel for="email" value="Email Address:" />
+ <h:inputText id="email" value="#{bean.email}"
label="Email">
+ <rich:beanValidator summary="Invalid Email address"/>
+ </h:inputText>
+ <rich:message for="email"/>
+ <h:outputLabel for="card" value="Credit card number:" />
+ <h:inputText id="card" value="#{bean.creditCardNumber}"
label="Credit card">
+ <rich:beanValidator summary="Invalid credit card number"/>
+ </h:inputText>
+ <rich:message for="card"/>
+ </h:panelGrid>
+ <h:commandButton value="Submit"></h:commandButton>
+ <rich:messages/>
+ </h:form>
+ </ui:define>
+</ui:composition>
+</html>
Property changes on:
trunk/examples/validator-demo/src/main/webapp/examples/beanValidation.xhtml
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: trunk/examples/validator-demo/src/main/webapp/examples/faces-validators.xhtml
===================================================================
--- trunk/examples/validator-demo/src/main/webapp/examples/faces-validators.xhtml
(rev 0)
+++
trunk/examples/validator-demo/src/main/webapp/examples/faces-validators.xhtml 2011-01-29
00:41:00 UTC (rev 21312)
@@ -0,0 +1,32 @@
+<html
xmlns="http://www.w3.org/1999/xhtml"
+
xmlns:f="http://java.sun.com/jsf/core"
+
xmlns:h="http://java.sun.com/jsf/html"
+
xmlns:ui="http://java.sun.com/jsf/facelets"
+
xmlns:csv="http://richfaces.org/csv"
+
xmlns:c="http://java.sun.com/jsp/jstl/core">
+<ui:composition template="/layout/template.xhtml">
+ <ui:param name="title" value="JSF validators on client" />
+ <!-- Page header -->
+ <ui:define name="header">
+ <h1><csv:validator> usage</h1>
+ </ui:define>
+ <!-- content -->
+ <ui:define name="content">
+ <h:form id="form">
+ <h:panelGrid columns="4">
+ <h:outputLabel for="text" value="Text length from 1 to
3:" />
+ <h:inputText id="text" value="#{test.value}">
+ <f:validateLength minimum="1" maximum="3" />
+ <csv:validator event="blur" />
+ </h:inputText>
+ <h:outputText id="out"
value="#{test.value}"></h:outputText>
+ <csv:message id="uiMessage" for="text" />
+ </h:panelGrid>
+ <h:commandButton value="Submit">
+ <csv:validator/>
+ </h:commandButton>
+ </h:form>
+ <csv:messages />
+ </ui:define>
+</ui:composition>
+</html>
\ No newline at end of file
Property changes on:
trunk/examples/validator-demo/src/main/webapp/examples/faces-validators.xhtml
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: trunk/examples/validator-demo/src/main/webapp/examples/graphValidation.xhtml
===================================================================
--- trunk/examples/validator-demo/src/main/webapp/examples/graphValidation.xhtml
(rev 0)
+++
trunk/examples/validator-demo/src/main/webapp/examples/graphValidation.xhtml 2011-01-29
00:41:00 UTC (rev 21312)
@@ -0,0 +1,41 @@
+<!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:f="http://java.sun.com/jsf/core"
+
xmlns:h="http://java.sun.com/jsf/html"
+
xmlns:ui="http://java.sun.com/jsf/facelets"
+
xmlns:a4j="http://richfaces.org/a4j"
+
xmlns:rich="http://richfaces.org/rich"
+
xmlns:s="http://jboss.com/products/seam/taglib"
+
xmlns:c="http://java.sun.com/jsp/jstl/core">
+<ui:composition template="/layout/template.xhtml">
+ <ui:param name="title" value="<rich:graphValidator>
usage" />
+ <ui:param name="javaBean"
value="org/richfaces/example/GraphValidatorBean.java" />
+ <!-- Page header -->
+ <ui:define name="header">
+ <h1><rich:graphValidator> usage</h1>
+ </ui:define>
+ <!-- content -->
+ <ui:define name="content">
+ <h:form id="form">
+ <rich:graphValidator value="#{graphValidatorBean}"
id="validator">
+ <h:panelGrid columns="3">
+ <h:outputLabel for="value0" value="First value:" />
+ <h:inputText id="value0" value="#{graphValidatorBean.first}"
label="First" />
+ <rich:message for="value0"/>
+ <h:outputLabel for="value1" value="Second value:" />
+ <h:inputText id="value1" value="#{graphValidatorBean.second}"
label="First" />
+ <rich:message for="value1"/>
+ <h:outputLabel for="value2" value="Third value:" />
+ <h:inputText id="value2" value="#{graphValidatorBean.third}"
label="First" />
+ <rich:message for="value2"/>
+ <h:outputLabel for="total" value="Total:" />
+ <h:outputText id="total"
value="#{graphValidatorBean.summ}"/>
+ </h:panelGrid>
+ <h:commandButton value="Submit"
action="#{graphValidatorBean.action}"></h:commandButton>
+ <h:outputText id="result"
value="#{graphValidatorBean.actionResult}"/>
+ </rich:graphValidator>
+ <rich:messages/>
+ </h:form>
+ </ui:define>
+</ui:composition>
+</html>
\ No newline at end of file
Property changes on:
trunk/examples/validator-demo/src/main/webapp/examples/graphValidation.xhtml
___________________________________________________________________
Name: svn:mime-type
+ text/plain