Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Changed Related Articles box to use {contentbylabel}, fixed some broken links, misspellings
Wiki Markup
{float:right|background=#eee}
{infocontentbylabel:title=Related Articles}
[Bean Validation]
{info|showLabels=false|showSpace=false|space=TAPESTRY|labels=validation}
{float}

Form Input and Validation

...

The Form component generates a number of component events that you may provide event handler methods for.

...

As with other action requests, the result of a form submission is to send a redirect to the client which re-renders the page. The ValidationTracker must be stored persistently between requests, or all the validation information will be lost (the default ValidationTracker provided by the Form is persistent).

...

Centralizing Validation with @Validate

The @Validate annotation can take the place of the validate parameter of TextField, PasswordField, TextArea and other components. When the validate parameter is not bound, the component will check for the @Validate annotation and use its value as the validation definition.

...

The message can be customized by adding an entry to the page's message catalog (or the containing component's message catalog). As with any localized property, this can also go into the application's message catalog.

...

Customizing Validation Messages / BeanEditForm

The BeanEditForm component also supports validation message customizing. The search is the similar; the formId is the component id of the BeanEditForm component (not the Form component it contains). The fieldId is the property name.

...

The event handler method has precendence precedence over the translator. Here it checks for the empty string (and note that the input may be null!) and evaluates that as zero.

...

The event handler may also throw a ValidationException to indicate a value that can't be parsed.

...