Jan 6th, 2005, 06:47 AM
I'm Newbe, Want to ask about createBoundFormattedTextField on SwingFormModel. I've make my validation for JFormattedTextField but I can't set the minLength(). if any body knows how to handle this ???? I have try using regex(), addMinLength(), and any(), but don't work. :?
Jan 6th, 2005, 09:37 AM
JFormattedTextField change value internal and it isn't good for validation.I try set property editor for date (JDateChooser, nacho ..) and it work bad because use JFormattedTextField
You can validation for length, regex etc in standard rcp framework and it work better than JFormattedTextField
Jan 6th, 2005, 11:40 AM
is there some way to create any component Like JTextField have same action like JFormattedTextField cause I really need action that can control how many input on conmponent, I meant create the maxLength() on JTextField and make an Inputer not more than maxlength(), if it does the inputer will stop and never more than maxlength().
thanks ,but i hope you will reply this post.
Jan 6th, 2005, 03:39 PM
I do this and post code in rcp devel list (try search for RevertAsYouTypeTextValueSetter)
In my code I have two kinds validation : revert (like max length, regex, and like) and not revert
(example, type 01 for date is invalid, but it isn't revert beacuse can be valid).
It is possible for JTextField with extends PlainDocument
I suggest that Constraint interface in RCP have method canBeValid or like and it resolve this problem complete - it work much better than JFormattedTextField - JFormattedTextFiled validation work after focus gain only, it change value internal and have much problems
Jan 24th, 2005, 06:45 AM
sorry for reply so long,
but I say Thank you, SNPE, i gonna search about RevertAsYouTypeTextValueSetter.