Author: drobiazko
Date: Sun Feb 22 19:26:42 2009
New Revision: 746803

URL: http://svn.apache.org/viewvc?rev=746803&view=rev
Log:
TAP5-527: Input validation documentation is missing clear list of available 
validators and their correct notation to use.

Modified:
    tapestry/tapestry5/trunk/src/site/apt/guide/validation.apt

Modified: tapestry/tapestry5/trunk/src/site/apt/guide/validation.apt
URL: 
http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/src/site/apt/guide/validation.apt?rev=746803&r1=746802&r2=746803&view=diff
==============================================================================
--- tapestry/tapestry5/trunk/src/site/apt/guide/validation.apt (original)
+++ tapestry/tapestry5/trunk/src/site/apt/guide/validation.apt Sun Feb 22 
19:26:42 2009
@@ -303,6 +303,28 @@
   formId is the BeanEditForm component's id, and the
   fieldId is the name of the property being editted.
 
+Available Validators
+
+  Currently Tapestry provides the following built-in validators:
+
+*-----------+-----------------+---------------------------------------------------------------------+-----------------------------------------------------------------------+
+| Validator | Constraint Type | Description                                    
                     | Example                                                  
             |
+*-----------+-----------------+---------------------------------------------------------------------+-----------------------------------------------------------------------+
+| email     | -               | Ensures that the given input is a valid e-mail 
address              | <<<\<t:textfield value="email" validate="email" /\>>>>   
             |
+*-----------+-----------------+---------------------------------------------------------------------+-----------------------------------------------------------------------+
+| max       | long            | Enforces a maximum integer value               
                     | <<<\<t:textfield value="age" validate="max=120,min=0" 
/\>>>>          |
+*-----------+-----------------+---------------------------------------------------------------------+-----------------------------------------------------------------------+
+| maxLength | int             | Makes sure that a string value has a maximum 
length                 | <<<\<t:textfield value="zip" validate="maxlength=7" 
/\>>>>            |
+*-----------+-----------------+---------------------------------------------------------------------+-----------------------------------------------------------------------+
+| min       | long            | Enforces a minimum integer value               
                     | <<<\<t:textfield value="age" validate="max=120,min=0" 
/\>>>>          |
+*-----------+-----------------+---------------------------------------------------------------------+-----------------------------------------------------------------------+
+| minLength | int             | Makes sure that a string value has a minimum 
length                 | <<<\<t:textfield value="somefield" 
validate="minlength=1" /\>>>>      |
+*-----------+-----------------+---------------------------------------------------------------------+-----------------------------------------------------------------------+
+| regexp    | pattern         | Makes sure that a string value conforms to a 
given pattern          | <<<\<t:textfield value="otherfield" 
validate="regexp=^[a-z]+$" /\>>>> |
+*-----------+-----------------+---------------------------------------------------------------------+-----------------------------------------------------------------------+
+| required  | -               | Makes sure that a string value is not null and 
not the empty string | <<<\<t:textfield value="name" validate="required" /\>>>> 
             |
+*-----------+-----------------+---------------------------------------------------------------------+-----------------------------------------------------------------------+
+
 Overriding the Translator with Events
 
   The TextField, PasswordField and TextArea components all have a translate 
parameter, a
@@ -380,3 +402,4 @@
   an input value will be rejected on the client side even though it is valid 
on the server side.   You may
   need to disable client-side validation in order to use this feature.
 
+


Reply via email to