Details
-
New Feature
-
Status: Closed
-
Minor
-
Resolution: Fixed
-
None
-
None
Description
Currently, there are two core-supported methods for specifying the validators to be applied to a particular form field: the @Validator annotation, and the validate attribute. Tapestry supports, however, specifying constraints to a specific validator in the .properties file. For instance:
<t:textfield t:id="someField" validate="regexp">
Could have an entry in the .properties file such as:
someField-regexp=^\d+$
someField-regexp-message=You must input a number for someField
What would be equally nice is to be able to specify the actually regexp validator as a constraint in the .properties file:
someField-validators=regexp
Or
someField-validators=required,regexp
This would be helpful for using, eg, BeanEditForm, where you might want to specify the constraints for a large number of fields, don't want to provide parameters for each of those fields, and you don't have access to the source to add @Validator to each of the properties.
This will probably take the form of a new ValidationConstraintGenerator, but there may be some additional "plumbing" involved to get access to the containing page/component's message catalog.