Uploaded image for project: 'Wicket'
  1. Wicket
  2. WICKET-4853

Change FormComponent#reportRequiredError() from private to protected

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Resolved
    • Trivial
    • Resolution: Fixed
    • None
    • 1.5.9, 6.3.0
    • wicket
    • None

    Description

      It is awkward to provide a custom "required" message for a form component from Java. One must override and re-implement validate(). Making the form component not required and providing an explicit validator is sub-optimal, since there may be other components that depend on the required flag. For example, I have a label component that automatically adds a star when attached to a required form component.

      Making FormComponent#reportRequiredError() protected would make this trivial.

      This was discussed here: http://mail-archives.apache.org/mod_mbox/wicket-dev/201204.mbox/%3CCAMomwMoL_EtXodWtrQhVNnuKrBnfDA+i93+fTSCF4BjyOYFyJQ@mail.gmail.com%3E

      Attachments

        Activity

          People

            mgrigorov Martin Tzvetanov Grigorov
            jkrasnay John Krasnay
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: