Wicket
  1. Wicket
  2. WICKET-1310

StringValidator.maximumLength should automatically add maxlength html attribute

    Details

    • Type: Improvement Improvement
    • Status: Resolved
    • Priority: Minor Minor
    • Resolution: Fixed
    • Affects Version/s: 1.3.1
    • Fix Version/s: 6.0.0-beta1
    • Component/s: None
    • Labels:
      None

      Description

      Validating max length of strings should not require a round trip to the server. adding the html attribute to forms will prevent data entry on the client side.

      I'm manually doing this as part of the wicketstuff-hibernate project, but it would be great to just have this built into wicket.
      http://wicket-stuff.svn.sourceforge.net/viewvc/wicket-stuff/trunk/wicketstuff-hibernate-behavior/src/main/java/org/wicketstuff/hibernate/annotation/HibernateAnnotationComponentConfigurator.java?view=markup

      I understand that currently validators can be used independently of Wicket and don't know about components or behaviors, but i'm recommending this be changed. Wicket is a web framework, not a validation library. If i want a portable validation library, I'll use commons-validation, not wicket. So, the validators should be web validators and be able to modify components or render custom javascript to help with web validation.

      FYI: tapestry does it! =)

      1. WICKET-1310.patch
        5 kB
        Attila Király
      2. patch.txt
        1 kB
        Ryan Sonnek

        Activity

          People

          • Assignee:
            Igor Vaynberg
            Reporter:
            Ryan Sonnek
          • Votes:
            1 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development