Uploaded image for project: 'Seam 2'
  1. Seam 2
  2. JBSEAM-1262

Should be able to customize Hibernate validation messages based on context (by page, or role like Seam component scopes)

    Details

    • Type: Feature Request
    • Status: Closed (View Workflow)
    • Priority: Major
    • Resolution: Out of Date
    • Affects Version/s: 1.2.1.GA
    • Fix Version/s: None
    • Component/s: None
    • Labels:
      None

      Description

      Currently, each validation specified a single message resource to be used as the error message. It would be helpful if there was some way to customize the error messages to be used such that in one case "Contact address is required." is displayed, while in others "Billing address is required", for example. Annotating model classes with validation rules limits the reuse of those classes since the validation messages offer limited flexibility.

      Since validated fields in the domain classes aren't necessarily associated with a UIInput on a page, it would be helpful to have more flexible annotations, such as:

      @MaxLength(messages =

      {@Message(role='contactForm', value='contact.too_long'), @Message(role='billingForm', value='billing.too_long')}

      )
      private String field;

      Also needed would be some way of indicated to the UIView which 'role' should be used when validation takes place.

        Gliffy Diagrams

          Attachments

            Activity

              People

              • Assignee:
                Unassigned
                Reporter:
                nstoddar Nathaniel Stoddard
              • Votes:
                6 Vote for this issue
                Watchers:
                5 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: