Uploaded image for project: 'Tapestry'
  1. Tapestry
  2. TAPESTRY-353

Validator API for easy re-validation of data

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Open
    • Major
    • Resolution: Unresolved
    • 4.0
    • 4.2
    • Framework
    • None

    Description

      It would be nice if there was a reasonable way to reuse a Validator to do business-logic level validation. Perhaps add a method to the Validator interface:

      public boolean isValid(Object object);

      For background: I'm building a multi-page wizard that edits a common shared data (stored as an ASO). At the end of the wizard, I need to check that all data from all pages is valid (the user is allowed to jump around in the wizard). I'm finding that I'm re-implementing a lot of validation checks in code, duplicating logic already associated with the fields (in the form of validator strings like "required,minLength=5").

      What would be nice would be to have an easy way to re-run the validations, just to generate a boolean. At the core of this is combining the current value for the component (possibly extracted right out of the business object) with the list of validators.

      Attachments

        Activity

          People

            Unassigned Unassigned
            hlship Howard Lewis Ship
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated: