• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Using a formatter to validate a wotextfield
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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

  • Follow-Ups:
    • Re: Using a formatter to validate a wotextfield
      • From: Robert Walker <email@hidden>
  • Prev by Date: Re: SQL Statements Order
  • Next by Date: Re: Flash/WebObjects
  • Previous by thread: Ajax Drag and Drop (dumb one)
  • Next by thread: Re: Using a formatter to validate a wotextfield
  • Index(es):
    • Date
    • Thread