[ 
https://issues.apache.org/jira/browse/WICKET-1310?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12610117#action_12610117
 ] 

Timo Rantalaiho commented on WICKET-1310:
-----------------------------------------

Likewise, sometimes even for TextField you want to allow the user to enter the 
whole input but show that she must shorten it. Take for example a case where 
the user pastes a long message from somewhere to a field that is used to enter 
text of an SMS message, max 160 characters. Then it's a lot better to show the 
whole input and an (Ajax / Javascript) error message right away to let the user 
shorten the message, instead of just cutting it at 160 characters.

So if something like this is done, it should be optional.

> StringValidator.maximumLength should automatically add maxlength html 
> attribute
> -------------------------------------------------------------------------------
>
>                 Key: WICKET-1310
>                 URL: https://issues.apache.org/jira/browse/WICKET-1310
>             Project: Wicket
>          Issue Type: Improvement
>    Affects Versions: 1.3.1
>            Reporter: Ryan Sonnek
>            Assignee: Johan Compagner
>            Priority: Minor
>             Fix For: 1.5-M1
>
>         Attachments: patch.txt
>
>
> 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!  =)

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply via email to