Author: ilya_shaikovsky
Date: 2011-01-24 06:04:08 -0500 (Mon, 24 Jan 2011)
New Revision: 21167
Modified:
trunk/examples/richfaces-showcase/src/main/webapp/richfaces/clientValidation/samples/simple-sample.xhtml
trunk/examples/richfaces-showcase/src/main/webapp/richfaces/clientValidation/simple.xhtml
Log:
CSV sample
Modified:
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-24
10:06:15 UTC (rev 21166)
+++
trunk/examples/richfaces-showcase/src/main/webapp/richfaces/clientValidation/samples/simple-sample.xhtml 2011-01-24
11:04:08 UTC (rev 21167)
@@ -6,21 +6,34 @@
xmlns:a4j="http://richfaces.org/a4j"
xmlns:rich="http://richfaces.org/rich">
<h:form>
- <rich:panel header="User information">
- <h:panelGrid columns="3">
+ <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="1" maximum="3"/>
+ <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">
+ <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" />
Modified:
trunk/examples/richfaces-showcase/src/main/webapp/richfaces/clientValidation/simple.xhtml
===================================================================
---
trunk/examples/richfaces-showcase/src/main/webapp/richfaces/clientValidation/simple.xhtml 2011-01-24
10:06:15 UTC (rev 21166)
+++
trunk/examples/richfaces-showcase/src/main/webapp/richfaces/clientValidation/simple.xhtml 2011-01-24
11:04:08 UTC (rev 21167)
@@ -5,6 +5,19 @@
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}"
/>
@@ -12,5 +25,20 @@
<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