• 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
takeValuesFromRequest question
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

takeValuesFromRequest question


  • Subject: takeValuesFromRequest question
  • From: Miguel Arroz <email@hidden>
  • Date: Tue, 20 Sep 2005 14:04:25 +0100

Hi!

First, sorry about posting so many basic question on this list... i'm really enjoying learning WO, and I want to know some details about the framework! :)

I'm trying to define a component (called ErrorLabel) that might (or not) display an error. The ideia is to put an instance of ErrorLabel next to a TextField, button, etc, so that when the value the user introduces is wrong, and error label appears next to that element.

I've learned that a component gets the values from the interface and sets them on the model object during the execution of takeValuesFromRequest. My ideia was to build validators on the model class, and catch the exceptions on the component.

The problem is that the takeValuesFromRequest is catching all the exceptions, and printing error messages on the console, like "[2005-09-20 13:41:29 WEST] <WorkerThread3> Validation failed on an object [null] with keypath = publicTicket.email and exception: The email property of Ticket is not allowed to be null."

How can I catch this exceptions, so that I may turn on the visibility of the error labels? Of course, I may redefine takeValuesFromRequest so that I grab all the values manually, and surround the code with a try/catch, but that looks lot a lot of pointless work, and lack of abstraction (if I need to add or remove a component, I will have to change that code manually). Following the "If you are writing code, you are doing something wrong" WebObjects non-official slogan, is there a better way to do this?

  Yours

Miguel Arroz

"We have no sympathy for the lost souls
We've chosen the path of disgrace
We give this life to our children
And teach them to hate this place" -- Apocalyptica, Life Burns!

Miguel Arroz
http://www.ipragma.com


_______________________________________________ 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: takeValuesFromRequest question
      • From: Arturo Perez <email@hidden>
    • Re: takeValuesFromRequest question
      • From: email@hidden
  • Prev by Date: Re: WOComponent API
  • Next by Date: Re: takeValuesFromRequest question
  • Previous by thread: Re: WOComponent API
  • Next by thread: Re: takeValuesFromRequest question
  • Index(es):
    • Date
    • Thread