Using a formatter to validate a wotextfield
Using a formatter to validate a wotextfield
- Subject: Using a formatter to validate a wotextfield
- From: Carter Wojcik <email@hidden>
- Date: Tue, 14 Nov 2006 09:56:52 -0800 (PST)
Hi All -
I have created a formatter that subclasses from
java.text.DecimalFormat. I am trying to enforce a rule
that the length of the data entered cannot be longer
than the associated format.
For example:
Format for field is: #0.#
Data entered in field is 100
I would like to throw an exception because 100
has three digits and the format only has two.
Currently I am checking the length in the parse(String
text, ParsePosition pos) method in my formatter class.
I have a custom component (containing setter and
getter methods for the bindings) that I bind my
formatter to. The formatter throws an exception, but I
am not able to catch it in my component (it comes back
as an exception page). I would like to catch the
exception and display an error message to the user
with custom text containing the error.
Seems that this validation could be done in the
formatter, instead of on the EO or component logic.
Thanks for any help.
Carter
____________________________________________________________________________________
Yahoo! Music Unlimited
Access over 1 million songs.
http://music.yahoo.com/unlimited
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden