-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 3 posts ] 
Author Message
 Post subject: Validator and potential error ?
PostPosted: Fri Dec 09, 2005 9:21 pm 
Expert
Expert

Joined: Sat Jun 12, 2004 4:49 pm
Posts: 915
i want use hibernate validator for validate user input key by key (swing application) and i need isolate definitely and potential error

for example,

@Length (min=3,max=10)

when user type first char then property is invalid, but can be valid and it is potential error
when user type 11th character then property is definitely invalid

i can deny 11th char, but i have to accept 1th and 2th

Is this possible with hibernate validator ?


Top
 Profile  
 
 Post subject:
PostPosted: Sat Dec 10, 2005 1:22 pm 
Hibernate Team
Hibernate Team

Joined: Sun Sep 14, 2003 3:54 am
Posts: 7256
Location: Paris, France
Not sure this is perfectly suited for such dynamic test.
And if you think about your use case a user could want to copy pastle a 11 sized string and schrink it: with your system this is not possible and really annoying.
I've always found such "smart" while-typing testing very annoying in a GUI.
The best to match your case is to execute Hibernate validator when the focus is lost.

_________________
Emmanuel


Top
 Profile  
 
 Post subject:
PostPosted: Sat Dec 10, 2005 2:40 pm 
Expert
Expert

Joined: Sat Jun 12, 2004 4:49 pm
Posts: 915
i do it with my annotations already and it work fine (for swing text component)
i do test in PlainDocument and when user type 11th char system beep and reject char
however, i have thought that use legacy hibernate validator

i now have hibernate Length validator (for minimal length only) and this test doesn't reject typing and special MaxLength annotations - it reject typed char
i need similar thing for another validation, too
Hibernate validator work great, but i want flag for potential valid, only


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 3 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.