Author: atsebro
Date: 2008-08-29 11:41:11 -0400 (Fri, 29 Aug 2008)
New Revision: 10241
Modified:
trunk/docs/userguide/en/src/main/docbook/included/ajaxValidator.xml
trunk/docs/userguide/en/src/main/docbook/included/beanValidator.xml
trunk/docs/userguide/en/src/main/docbook/included/graphValidator.xml
Log:
RF-3903: Documenting-Validator tags
Modified: trunk/docs/userguide/en/src/main/docbook/included/ajaxValidator.xml
===================================================================
--- trunk/docs/userguide/en/src/main/docbook/included/ajaxValidator.xml 2008-08-29
15:37:53 UTC (rev 10240)
+++ trunk/docs/userguide/en/src/main/docbook/included/ajaxValidator.xml 2008-08-29
15:41:11 UTC (rev 10241)
@@ -1,202 +1,190 @@
<?xml version="1.0" encoding="UTF-8"?>
<section>
- <sectioninfo>
- <keywordset>
- <keyword>rich:ajaxValidator</keyword>
- </keywordset>
- </sectioninfo>
+ <sectioninfo>
+ <keywordset>
+ <keyword>rich:ajaxValidator</keyword>
+ </keywordset>
+ </sectioninfo>
- <table>
- <title>Component identification parameters</title>
+ <table>
+ <title>Component identification parameters</title>
- <tgroup cols="2">
- <thead>
- <row>
- <entry>Name</entry>
+ <tgroup cols="2">
+ <thead>
+ <row>
+ <entry>Name</entry>
- <entry>Value</entry>
- </row>
- </thead>
+ <entry>Value</entry>
+ </row>
+ </thead>
- <tbody>
- <row>
- <entry>component-type</entry>
+ <tbody>
+ <row>
+
<entry>component-type</entry>
- <entry>org.richfaces.ajaxValidator</entry>
- </row>
+
<entry>org.richfaces.ajaxValidator</entry>
+ </row>
- <row>
- <entry>component-class</entry>
+ <row>
+
<entry>component-class</entry>
- <entry>org.richfaces.component.html.HtmlajaxValidator</entry>
- </row>
+
<entry>org.richfaces.component.html.HtmlajaxValidator</entry>
+ </row>
- <row>
- <entry>component-family</entry>
+ <row>
+
<entry>component-family</entry>
- <entry>org.richfaces.ajaxValidator</entry>
- </row>
+
<entry>org.richfaces.ajaxValidator</entry>
+ </row>
- <row>
- <entry>renderer-type</entry>
+ <row>
+
<entry>renderer-type</entry>
- <entry>org.richfaces.ajaxValidatorRenderer</entry>
- </row>
+
<entry>org.richfaces.ajaxValidatorRenderer</entry>
+ </row>
- <row>
- <entry>tag-class</entry>
+ <row>
+ <entry>tag-class</entry>
- <entry>org.richfaces.taglib.ajaxValidatorTag</entry>
- </row>
- </tbody>
- </tgroup>
- </table>
+
<entry>org.richfaces.taglib.ajaxValidatorTag</entry>
+ </row>
+ </tbody>
+ </tgroup>
+ </table>
- <section>
- <title>Creating the Component with a Page Tag</title>
+ <section>
+ <title>Creating the Component with a Page Tag</title>
- <para>To create the simplest variant on a page use the following
syntax:</para>
+ <para>To create the simplest variant on a page use the
following syntax:</para>
- <para>
- <emphasis role="bold">Example:</emphasis>
- </para>
- <programlisting role="XML"><![CDATA[...
- <h:outputText value="Name:" />
- <h:inputText value="#{userBean.name}" id="name"
required="true">
- <f:validateLength minimum="3"
maximum="12"/>
- <rich:ajaxValidator event="onblur"/>
- </h:inputText>
+ <para>
+ <emphasis
role="bold">Example:</emphasis>
+ </para>
+ <programlisting role="XML"><![CDATA[...
+<h:outputText value="Name:" />
+<h:inputText value="#{userBean.name}" id="name"
required="true">
+ <f:validateLength minimum="3" maximum="12"/>
+ <rich:ajaxValidator event="onblur"/>
+</h:inputText>
...]]></programlisting>
- </section>
+ </section>
- <section>
- <title>Creating the Component Dynamically Using Java</title>
+ <section>
+ <title>Creating the Component Dynamically Using
Java</title>
- <para>
- <emphasis role="bold">Example:</emphasis>
- </para>
- <programlisting role="JAVA"><![CDATA[import
org.richfaces.component.html.HtmlCalendar;
+ <para>
+ <emphasis
role="bold">Example:</emphasis>
+ </para>
+ <programlisting role="JAVA"><![CDATA[import
org.richfaces.component.html.HtmlCalendar;
...
HtmlAjaxValidator myAjaxValidator= new HtmlAjaxValidator();
...
]]></programlisting>
- </section>
- <section>
- <title>Details of Usage</title>
-
- <para>The <emphasis
role="bold"><property><rich:ajaxValidator></property></emphasis>
component should
- be added as a child component to an input JSF tag which data
- should be validated and an event that triggers validation should be specified as
well.
- The component is ajaxSingle by default so only the current field will be
validated.</para>
-
-
- <para>The following example demonstrates how the <emphasis
role="bold"><property><rich:ajaxValidator></property></emphasis>
adds AJAX functionality to standard JSF validators.
- The request is sent when the input field loses focus,
- the action is determined by the
<emphasis><property>"event"</property></emphasis>
attribute that is set to <code>"onblur"</code>.
- </para>
-
-
-
- <programlisting role="XML"><![CDATA[...
- <h:form>
- <rich:panel>
- <f:facet name="header">
- <h:outputText value="User Info:" />
- </f:facet>
- <h:panelGrid columns="3">
-
- <h:outputText value="Name:" />
- <h:inputText value="#{userBean.name}" id="name"
required="true">
- <f:validateLength minimum="3"
maximum="12"/>
- <rich:ajaxValidator event="onblur"/>
- </h:inputText>
- <rich:message for="name" />
-
- <h:outputText value="Age:" />
- <h:inputText value="#{userBean.age}" id="age"
required="true">
- <f:convertNumber integerOnly="true"/>
- <f:validateLongRange minimum="18"
maximum="99"/>
- <rich:ajaxValidator event="onblur"/>
- </h:inputText>
- <rich:message for="age"/>
-
- </h:panelGrid>
- </rich:panel>
- </h:form>
- ...]]></programlisting>
-
- <para>This is the result of the snippet. </para>
-
-
- <figure>
- <title>Simple example of <emphasis
role="bold"><property><rich:ajaxValidator></property></emphasis>with
-</title>
- <mediaobject>
- <imageobject>
- <imagedata fileref="images/ajaxValidator1.png"/>
- </imageobject>
- </mediaobject>
- </figure>
-
-
- <para>In the example above it's show how to work with standard JSF
validators.
- The <emphasis
role="bold"><property><rich:ajaxValidator></property></emphasis>
component also works perfectly with
- custom validators enhancing their usage with AJAX.
- </para>
+ </section>
+ <section>
+ <title>Details of Usage</title>
- <para>
- Custom validation can be performed in two ways:
- </para>
-
- <itemizedlist>
- <listitem><para>Using JSF Validation API is available in
javax.faces.validator package</para></listitem>
- <listitem><para>Using Hibernate Validator, specifying a constraint for
the data to be validated. A reference on Hibernate Validator can be found <ulink
url="http://www.hibernate.org/hib_docs/validator/reference/en/html_s...
- </itemizedlist>
-
- <para>
- The following example shows how the data entered by user can be validated using
Hibernate Validator.
- </para>
+ <para>The <emphasis role="bold">
+
<property><rich:ajaxValidator></property>
+ </emphasis> component should be added as a child
component to an input
+ JSF tag which data should be validated and an event that
triggers
+ validation should be specified as well. The component is
ajaxSingle by
+ default so only the current field will be
validated.</para>
- <programlisting role="XML"><![CDATA[...
- <rich:panel>
- <f:facet name="header">
- <h:outputText value="User Info:" />
- </f:facet>
- <h:panelGrid columns="3">
-
- <h:outputText value="Name:" />
- <h:inputText value="#{validationBean.name}" id="name"
required="true">
- <rich:ajaxValidator event="onblur" />
- </h:inputText>
- <rich:message for="name" />
- <h:outputText value="Email:" />
- <h:inputText value="#{validationBean.email}" id="email">
- <rich:ajaxValidator event="onblur" />
- </h:inputText>
- <rich:message for="email" />
- <h:outputText value="Age:" />
- <h:inputText value="#{validationBean.age}" id="age">
- <rich:ajaxValidator event="onblur" />
- </h:inputText>
- <rich:message for="age" />
- </h:panelGrid>
- </rich:panel>
- ...]]></programlisting>
-
-
- <para>Here is the source code of the managed bean.</para>
-
-
- <programlisting role="JAVA"><![CDATA[...
+
+ <para>The following example demonstrates how the <emphasis
role="bold">
+
<property><rich:ajaxValidator></property>
+ </emphasis> adds AJAX functionality to standard JSF
validators. The
+ request is sent when the input field loses focus, the
action is
+ determined by the <emphasis>
+
<property>"event"</property>
+ </emphasis> attribute that is set to
+ <code>"onblur"</code>.
</para>
+
+
+
+ <programlisting role="XML"><![CDATA[...
+<rich:panel>
+ <f:facet name="header">
+ <h:outputText value="User Info:" />
+ </f:facet>
+ <h:panelGrid columns="3">
+ <h:outputText value="Name:" />
+ <h:inputText value="#{userBean.name}" id="name"
required="true">
+ <f:validateLength minimum="3"
maximum="12"/>
+ <rich:ajaxValidator event="onblur"/>
+ </h:inputText>
+ <rich:message for="name" />
+ </h:panelGrid>
+</rich:panel>
+...]]></programlisting>
+
+ <para>This is the result of the snippet. </para>
+
+
+ <figure>
+ <title>Simple example of <emphasis
role="bold">
+
<property><rich:ajaxValidator></property>
+ </emphasis>with </title>
+ <mediaobject>
+ <imageobject>
+ <imagedata
fileref="images/ajaxValidator1.png"/>
+ </imageobject>
+ </mediaobject>
+ </figure>
+
+
+ <para>In the example above it's show how to work with
standard JSF validators.
+ The <emphasis role="bold">
+
<property><rich:ajaxValidator></property>
+ </emphasis> component also works perfectly with
custom validators
+ enhancing their usage with AJAX. </para>
+
+ <para> Custom validation can be performed in two ways:
</para>
+
+ <itemizedlist>
+ <listitem>
+ <para>Using JSF Validation API is available
in
+ javax.faces.validator
package</para>
+ </listitem>
+ <listitem>
+ <para>Using Hibernate Validator, specifying
a constraint for
+ the data to be validated. A reference
on Hibernate
+ Validator can be found <ulink
+
url="http://www.hibernate.org/hib_docs/validator/reference/en/html_s...
+ >here</ulink>.</para>
+ </listitem>
+ </itemizedlist>
+
+ <para> The following example shows how the data entered by user
can be validated
+ using Hibernate Validator. </para>
+
+ <programlisting role="XML"><![CDATA[...
+<rich:panel>
+ <f:facet name="header">
+ <h:outputText value="User Info:" />
+ </f:facet>
+ <h:panelGrid columns="3">
+ <h:outputText value="Name:" />
+ <h:inputText value="#{validationBean.name}"
id="name" required="true">
+ <rich:ajaxValidator event="onblur" />
+ </h:inputText>
+ <rich:message for="name" />
+ </h:panelGrid>
+</rich:panel>
+...]]></programlisting>
+
+
+ <para>Here is the source code of the managed
bean.</para>
+
+
+ <programlisting role="JAVA"><![CDATA[...
package org.richfaces.demo.validation;
+import org.hibernate.validator.NotEmpty;
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;
public class ValidationBean {
@@ -206,11 +194,7 @@
@Email (message="wrong email format")
@NotEmpty
private String email;
- @NotNull
- @Min(18)
- @Max(100)
- private int age;
-
+
public ValidationBean() {
}
public String getName() {
@@ -225,32 +209,26 @@
public void setEmail(String email) {
this.email = email;
}
- public int getAge() {
- return age;
- }
- public void setAge(int age) {
- this.age = age;
- }
}
-...]]></programlisting>
-
- <para>By default the Hibernate Validator generates an error message in 10
language, though you can redefine the messages that are displayed to a user when
validation fails. In the shows example it was done by adding
<code>(message="wrong email format")</code> to the
<code>@Email</code> annotation.</para>
-
- <para>This is how it looks. </para>
- <figure>
- <title>Validation using Hibernate validator
- </title>
- <mediaobject>
- <imageobject>
- <imagedata fileref="images/ajaxValidator2.png"/>
- </imageobject>
- </mediaobject>
- </figure>
-
-
- </section>
-
-</section>
+...]]></programlisting>
+ <para>By default the Hibernate Validator generates an error
message in 10
+ language, though you can redefine the messages that are
displayed to a
+ user when validation fails. In the shows example it was
done by adding
+ <code>(message="wrong email
+ format")</code> to the
<code>@Email</code> annotation.</para>
+ <para>This is how it looks. </para>
+ <figure>
+ <title>Validation using Hibernate validator
</title>
+ <mediaobject>
+ <imageobject>
+ <imagedata
fileref="images/ajaxValidator2.png"/>
+ </imageobject>
+ </mediaobject>
+ </figure>
+
+ </section>
+
+</section>
Modified: trunk/docs/userguide/en/src/main/docbook/included/beanValidator.xml
===================================================================
--- trunk/docs/userguide/en/src/main/docbook/included/beanValidator.xml 2008-08-29
15:37:53 UTC (rev 10240)
+++ trunk/docs/userguide/en/src/main/docbook/included/beanValidator.xml 2008-08-29
15:41:11 UTC (rev 10241)
@@ -1,139 +1,134 @@
<?xml version="1.0" encoding="UTF-8"?>
<section>
- <sectioninfo>
- <keywordset>
- <keyword>rich:beanValidator</keyword>
- </keywordset>
- </sectioninfo>
+ <sectioninfo>
+ <keywordset>
+ <keyword>rich:beanValidator</keyword>
+ </keywordset>
+ </sectioninfo>
- <table>
- <title>Component identification parameters</title>
+ <table>
+ <title>Component identification parameters</title>
- <tgroup cols="2">
- <thead>
- <row>
- <entry>Name</entry>
+ <tgroup cols="2">
+ <thead>
+ <row>
+ <entry>Name</entry>
- <entry>Value</entry>
- </row>
- </thead>
+ <entry>Value</entry>
+ </row>
+ </thead>
- <tbody>
- <row>
- <entry>component-type</entry>
+ <tbody>
+ <row>
+
<entry>component-type</entry>
- <entry>org.richfaces.beanValidator</entry>
- </row>
+
<entry>org.richfaces.beanValidator</entry>
+ </row>
- <row>
- <entry>component-class</entry>
+ <row>
+
<entry>component-class</entry>
- <entry>org.richfaces.component.html.HtmlbeanValidator</entry>
- </row>
+
<entry>org.richfaces.component.html.HtmlbeanValidator</entry>
+ </row>
- <row>
- <entry>component-family</entry>
+ <row>
+
<entry>component-family</entry>
- <entry>org.richfaces.beanValidator</entry>
- </row>
+
<entry>org.richfaces.beanValidator</entry>
+ </row>
- <row>
- <entry>renderer-type</entry>
+ <row>
+
<entry>renderer-type</entry>
- <entry>org.richfaces.beanValidatorRenderer</entry>
- </row>
+
<entry>org.richfaces.beanValidatorRenderer</entry>
+ </row>
- <row>
- <entry>tag-class</entry>
+ <row>
+ <entry>tag-class</entry>
- <entry>org.richfaces.taglib.beanValidatorTag</entry>
- </row>
- </tbody>
- </tgroup>
- </table>
+
<entry>org.richfaces.taglib.beanValidatorTag</entry>
+ </row>
+ </tbody>
+ </tgroup>
+ </table>
- <section>
- <title>Creating the Component with a Page Tag</title>
+ <section>
+ <title>Creating the Component with a Page Tag</title>
- <para>To create the simplest variant of the component on a page use the
following syntax:</para>
+ <para>To create the simplest variant of the component on a page
use the
+ following syntax:</para>
- <para>
- <emphasis role="bold">Example:</emphasis>
- </para>
- <programlisting role="XML"><![CDATA[...
+ <para>
+ <emphasis
role="bold">Example:</emphasis>
+ </para>
+ <programlisting role="XML"><![CDATA[...
<h:inputText value="#{validationBean.email}" id="email">
-<rich:beanValidator summary="Invalid email"/>
+ <rich:beanValidator summary="Invalid email"/>
</h:inputText>
...]]></programlisting>
- </section>
+ </section>
- <section>
- <title>Creating the Component Dynamically Using Java</title>
+ <section>
+ <title>Creating the Component Dynamically Using
Java</title>
- <para>
- <emphasis role="bold">Example:</emphasis>
- </para>
- <programlisting role="JAVA"><![CDATA[import
org.richfaces.component.html.HtmlCalendar;
+ <para>
+ <emphasis
role="bold">Example:</emphasis>
+ </para>
+ <programlisting role="JAVA"><![CDATA[import
org.richfaces.component.html.HtmlCalendar;
...
HtmlbeanValidator mybeanValidator= new HtmlbeanValidator();
...
]]></programlisting>
-
-
- <!-- Start Details of Usage-->
- <section>
- <title>Details of Usage</title>
-
- <para>
- Starting from 3.2.2 GA version Rich Faces provides support for model-based constraints
defined using Hibernate Validator.
- Thus it's possible to use Hibernate Validators the same as for Seam based
applications.
- </para>
-
- <para>The <emphasis
role="bold"><property><rich:beanValidator></property></emphasis>
- component is defined in the same way as any JSF validator. Look at the example
below.
- </para>
-
- <programlisting role="XML"><![CDATA[...
- <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>
- ...]]></programlisting>
-
- <para>Please play close attention on the bean code that contains the
constraints
- defined with Hibernate annotation which perform validation of the input
data.</para>
-
- <programlisting role="JAVA"><![CDATA[
+
+
+ <!-- Start Details of Usage-->
+ <section>
+ <title>Details of Usage</title>
+
+ <para> Starting from 3.2.2 GA version Rich Faces
provides support for
+ model-based constraints defined using Hibernate
Validator.
+ Thus it's possible to use Hibernate
Validators the same as
+ for Seam based applications. </para>
+
+ <para>The <emphasis role="bold">
+
<property><rich:beanValidator></property>
+ </emphasis> component is defined in the
same way as any JSF
+ validator. Look at the example below.
</para>
+
+ <programlisting role="XML"><![CDATA[...
+<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" />
+ <f:facet name="footer">
+ <a4j:commandButton value="Submit"
action="#{validationBean.success}" reRender="progress"/>
+ </f:facet>
+ </h:panelGrid>
+</rich:panel>
+...]]></programlisting>
+
+ <para>Please play close attention on the bean code
that contains the
+ constraints defined with Hibernate annotation
which perform
+ validation of the input data.</para>
+
+ <programlisting role="JAVA"><![CDATA[
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;
public class ValidationBean {
@@ -143,10 +138,6 @@
@Email
@NotEmpty
private String email;
- @NotNull
- @Min(18)
- @Max(100)
- private int age;
public ValidationBean() {
}
@@ -166,33 +157,33 @@
public void setEmail(String email) {
this.email = email;
}
+}]]></programlisting>
- public int getAge() {
- return age;
- }
+ <para>The following figure shows what happens if
validation fails</para>
- public void setAge(int age) {
- this.age = age;
- }
-}]]></programlisting>
-
-<para>The following figure shows what happens if validation fails</para>
-
- <figure>
- <title><emphasis
role="bold"><property><rich:beanValidator></property></emphasis>
usage</title>
- <mediaobject>
- <imageobject>
- <imagedata fileref="images/beanValidator1.png"/>
- </imageobject>
- </mediaobject>
- </figure>
- <para>As you can see from the example that in order to validate the
<emphasis
role="bold"><property><rich:beanValidator></property></emphasis>
- should be nested into a input JSF or RichFaces component.
- </para>
-
- <para>The component has the only attribute -
<emphasis><property>"summary"</property></emphasis>which
displays validation messages about validation errors.</para>
- </section>
- </section>
+ <figure>
+ <title><emphasis
role="bold">
+
<property><rich:beanValidator></property>
+ </emphasis> usage</title>
+ <mediaobject>
+ <imageobject>
+ <imagedata
+
fileref="images/beanValidator1.png"
+ />
+ </imageobject>
+ </mediaobject>
+ </figure>
+ <para>As you can see from the example that in order
to validate the
+ <emphasis role="bold">
+
<property><rich:beanValidator></property>
+ </emphasis> should be nested into a input
JSF or RichFaces
+ component. </para>
-</section>
+ <para>The component has the only attribute -
<emphasis>
+
<property>"summary"</property>
+ </emphasis>which displays validation
messages about
+ validation errors.</para>
+ </section>
+ </section>
+</section>
Modified: trunk/docs/userguide/en/src/main/docbook/included/graphValidator.xml
===================================================================
--- trunk/docs/userguide/en/src/main/docbook/included/graphValidator.xml 2008-08-29
15:37:53 UTC (rev 10240)
+++ trunk/docs/userguide/en/src/main/docbook/included/graphValidator.xml 2008-08-29
15:41:11 UTC (rev 10241)
@@ -1,137 +1,146 @@
<?xml version="1.0" encoding="UTF-8"?>
<section>
- <sectioninfo>
- <keywordset>
- <keyword>rich:graphValidator</keyword>
- </keywordset>
- </sectioninfo>
+ <sectioninfo>
+ <keywordset>
+ <keyword>rich:graphValidator</keyword>
+ </keywordset>
+ </sectioninfo>
- <table>
- <title>Component identification parameters</title>
+ <table>
+ <title>Component identification parameters</title>
- <tgroup cols="2">
- <thead>
- <row>
- <entry>Name</entry>
+ <tgroup cols="2">
+ <thead>
+ <row>
+ <entry>Name</entry>
- <entry>Value</entry>
- </row>
- </thead>
+ <entry>Value</entry>
+ </row>
+ </thead>
- <tbody>
- <row>
- <entry>component-type</entry>
+ <tbody>
+ <row>
+
<entry>component-type</entry>
- <entry>org.richfaces.graphValidator</entry>
- </row>
+
<entry>org.richfaces.graphValidator</entry>
+ </row>
- <row>
- <entry>component-class</entry>
+ <row>
+
<entry>component-class</entry>
- <entry>org.richfaces.component.html.HtmlgraphValidator</entry>
- </row>
+
<entry>org.richfaces.component.html.HtmlgraphValidator</entry>
+ </row>
- <row>
- <entry>component-family</entry>
+ <row>
+
<entry>component-family</entry>
- <entry>org.richfaces.graphValidator</entry>
- </row>
+
<entry>org.richfaces.graphValidator</entry>
+ </row>
- <row>
- <entry>renderer-type</entry>
+ <row>
+
<entry>renderer-type</entry>
- <entry>org.richfaces.graphValidatorRenderer</entry>
- </row>
+
<entry>org.richfaces.graphValidatorRenderer</entry>
+ </row>
- <row>
- <entry>tag-class</entry>
+ <row>
+ <entry>tag-class</entry>
- <entry>org.richfaces.taglib.graphValidatorTag</entry>
- </row>
- </tbody>
- </tgroup>
- </table>
+
<entry>org.richfaces.taglib.graphValidatorTag</entry>
+ </row>
+ </tbody>
+ </tgroup>
+ </table>
- <section>
- <title>Creating the Component with a Page Tag</title>
+ <section>
+ <title>Creating the Component with a Page Tag</title>
- <para>To create the simplest variant on a page use the following
syntax:</para>
+ <para>To create the simplest variant on a page use the
following syntax:</para>
- <para>
- <emphasis role="bold">Example:</emphasis>
- </para>
- <programlisting role="XML"><![CDATA[...
- <h:outputText value="Name:" />
- <h:inputText value="#{userBean.name}" id="name"
required="true">
- <f:validateLength minimum="3"
maximum="12"/>
- <rich:graphValidator event="onblur"/>
- </h:inputText>
+ <para>
+ <emphasis
role="bold">Example:</emphasis>
+ </para>
+ <programlisting role="XML"><![CDATA[...
+<h:outputText value="Name:" />
+ <h:inputText value="#{userBean.name}" id="name"
required="true">
+ <f:validateLength minimum="3" maximum="12"/>
+ <rich:graphValidator event="onblur"/>
+ </h:inputText>
...]]></programlisting>
- </section>
+ </section>
- <section>
- <title>Creating the Component Dynamically Using Java</title>
+ <section>
+ <title>Creating the Component Dynamically Using
Java</title>
- <para>
- <emphasis role="bold">Example:</emphasis>
- </para>
- <programlisting role="JAVA"><![CDATA[import
org.richfaces.component.html.HtmlCalendar;
+ <para>
+ <emphasis
role="bold">Example:</emphasis>
+ </para>
+ <programlisting role="JAVA"><![CDATA[import
org.richfaces.component.html.HtmlCalendar;
...
HtmlgraphValidator mygraphValidator= new HtmlgraphValidator();
...
]]></programlisting>
-
-
- </section>
-
- <para> The<emphasis role="bold">
-
<property><rich:graphValidator></property></emphasis>component
behaves basically the same way as the <emphasis role="bold">
- <property><rich:beanValidator></property></emphasis>
- The deference between these two components is that in order to validate some input
data with a <emphasis role="bold">
-
<property><rich:beanValidator></property></emphasis>
component, it should be a nested element of an input component, whereas <emphasis
role="bold">
-
<property><rich:graphValidator></property></emphasis>
wraps multiple input components and validates the data received from them.
- </para>
- <para>The following example demonstrate a pattern of how the <emphasis
role="bold">
- <property><rich:graphValidator></property></emphasis>
can be used.</para>
- <programlisting role="XML"><![CDATA[...
- <rich:graphValidator>
- <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:panelGrid>
- </rich:graphValidator>
- ...
+ </section>
+
+ <para> The<emphasis role="bold">
+
<property><rich:graphValidator></property>
+ </emphasis>component behaves basically the same way as the
<emphasis role="bold">
+
<property><rich:beanValidator></property>
+ </emphasis> The deference between these two components is that
in order to
+ validate some input data with a <emphasis
role="bold">
+
<property><rich:beanValidator></property>
+ </emphasis> component, it should be a nested element of an
input component,
+ whereas <emphasis role="bold">
+
<property><rich:graphValidator></property>
+ </emphasis> wraps multiple input components and validates the
data received from
+ them. </para>
+
+ <para>The following example demonstrate a pattern of how the <emphasis
role="bold">
+
<property><rich:graphValidator></property>
+ </emphasis> can be used.</para>
+ <programlisting role="XML"><![CDATA[...
+<rich:graphValidator>
+ <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:panelGrid>
+</rich:graphValidator>
+...
]]></programlisting>
-
- <para>The data validation can be also performed using Hibernate Validator, the
same way as it is done with <emphasis role="bold">
- <property><rich:beanValidator></property></emphasis>.
</para>
-
+ <para>The data validation can be also performed using Hibernate
Validator, the same way as
+ it is done with <emphasis role="bold">
+
<property><rich:beanValidator></property>
+ </emphasis>. </para>
- <para>The components's architecture provides an option to bind the
component to a managed bean, which is done with the <emphasis >
- <property><value></property></emphasis> attribute.
The attribute ensures that the entered data is valid after the model is updated by
revalidating the bean properties.</para>
- <para>Please look at the example below.</para>
-
-
- <programlisting role="XML"><![CDATA[...
- <rich:graphValidator value="#{dayStatistics}">
- <h:outputText value="#{pt.title}" /><
- <rich:inputNumberSpinne minValue="0" maxValue="24"
value="#{pt.time}" id="time">
+
+
+ <para>The components's architecture provides an option to bind
the component to a
+ managed bean, which is done with the <emphasis>
+ <property><value></property>
+ </emphasis> attribute. The attribute ensures that the entered
data is valid
+ after the model is updated by revalidating the bean
properties.</para>
+ <para>Please look at the example below.</para>
+
+
+ <programlisting role="XML"><![CDATA[...
+<rich:graphValidator value="#{dayStatistics}">
+ <h:outputText value="#{pt.title}" />
+ <rich:inputNumberSpinne minValue="0" maxValue="24"
value="#{pt.time}" id="time">
</rich:inputNumberSpinner>
- <rich:message for="time" />
+ <rich:message for="time" />
</rich:graphValidator>
- ...
+...
]]></programlisting>
-
+
</section>
-