Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Gave example of printf-style formatting in validation error message

...

For example, if the form ID is "loginForm", the field ID is "userName", and the validator is "required" then Tapestry will first look for a "loginForm-userName-required-message" key in the message catalog, and then for a "userName-required-message" key.

The validation message in the message catalog may contain printf-style format strings (such as %s) to indicate where the validate parameter's value will be inserted. For example, if the validate parameter in the template is minLength=3 and the validation message is "User name must be at least %s characters" then the corresponding error message would be "User name must be at least 5 characters".

Customizing Validation Messages for BeanEditForm

...