Jakarta > Tapestry
Jakarta
 
Font size:      

Input Validation

Coming soon ...

ValidField component

FieldLabel component

Validators

validator: binding prefix

The validator: binding prefix is a powerful shorthand for specifying validators. The string provided does two things: it identifies (by a short logical name) the Java class of the validator to create, and it specifies (as a comma seperated list) the properties of the validator to set. The form of the string is:

validator:name[,property[=value]]*
  

The name corresponds to contributions to the tapestry.valid.Validators configuration point. After the name is a list of properties to set. A simple conversion from string value to actual data type is performed. For boolean properties, the value can be skipped and will default to true. Alternatly, the value can be prefixed with an exclamation point, and the property will be set to false. Example:

validator:string,required,minimumLength=5

In some cases, this is insufficiently powerful to set the properties of the validator instance, in which case the <bean> element can be used instead.

The following validator names are defined:

Name IValidator implementation class
string StringValidator
date DateValidator
email EmailValidator
url UrlValidator
int IntValidator