• 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
Re: What is the best way to handle invalid values from a WOTextField?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: What is the best way to handle invalid values from a WOTextField?


  • Subject: Re: What is the best way to handle invalid values from a WOTextField?
  • From: Andrew Lindesay <email@hidden>
  • Date: Thu, 17 Jul 2008 08:11:22 +1200

Hello Guido;

I store the bad value in "validationFailedWithException(..)" and then when the key-path hits the component controller again during the "appendToResponse(..)" phase, it regurgitates the bad value to the element (WOTextField usually) rather than taking it from the EO. This way "bad data" can make its way back onto the page without every mucking up an EO's clean state. In the case of a formatter, if it experiences a format exception, it seems to let the string through. This seems to be workable for me over a wide range of situations.

cheers.

I am guessing this is an attempt to deal with the problem of the input value getting discarded if it failed to format. It is reasonable to want to show the invalid value to the user with a message and allow them to edit it into the correct format. This is just the wrong way to do that.

Hmmm, is there any other way than binding to a string variable in the EO and if it parses set the date / number value from it and if not throw an exception but keep it in the variable? If I attach a formatter to a text field because I NEED to format a string into a number or date object, it is just plain impossible to push that value into the object (ClassCastException). So do I not understand how that was ever intended to work or is it really just a bad idea in the first place?

___ Andrew Lindesay www.lindesay.co.nz

_______________________________________________
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: What is the best way to handle invalid values from a WOTextField?
      • From: Lachlan Deck <email@hidden>
References: 
 >Re: What is the best way to handle invalid values from a WOTextField? (From: Lachlan Deck <email@hidden>)
 >Re: What is the best way to handle invalid values from a WOTextField? (From: Chuck Hill <email@hidden>)
 >Re: What is the best way to handle invalid values from a WOTextField? (From: Chuck Hill <email@hidden>)
 >Re: What is the best way to handle invalid values from a WOTextField? (From: Guido Neitzer <email@hidden>)
 >Re: What is the best way to handle invalid values from a WOTextField? (From: Chuck Hill <email@hidden>)
 >Re: What is the best way to handle invalid values from a WOTextField? (From: Lachlan Deck <email@hidden>)
 >Re: What is the best way to handle invalid values from a WOTextField? (From: Chuck Hill <email@hidden>)
 >Re: What is the best way to handle invalid values from a WOTextField? (From: Guido Neitzer <email@hidden>)
 >Re: What is the best way to handle invalid values from a WOTextField? (From: Chuck Hill <email@hidden>)
 >Re: What is the best way to handle invalid values from a WOTextField? (From: Guido Neitzer <email@hidden>)

  • Prev by Date: [OT] Chuck is hiring: looking for a Sys Admin
  • Next by Date: Re: Not a wocomponent?
  • Previous by thread: Re: What is the best way to handle invalid values from a WOTextField?
  • Next by thread: Re: What is the best way to handle invalid values from a WOTextField?
  • Index(es):
    • Date
    • Thread