• 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
Validation Question and inline bindings again
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Validation Question and inline bindings again


  • Subject: Validation Question and inline bindings again
  • From: "Chan Yeow Heong, Jerome" <email@hidden>
  • Date: Wed, 09 Sep 2009 01:49:40 +0800

I override validationFailedWithException to catch the (throwable t Object value String keyPath) and store them into a page level NSMutableDictionary using keyPath as the key and a custom class to hold the variables t and value. This custom class has isError (returns a true if the keyPath exists and false if it doesn't], message (which is just the exception.getMessage result) and class (which returns a css class based on if there is an error or not for that attribute).

This error dictionary is named validationError.

I'd like to be able to do

<p>
<label>Account</label>
<wo:WOConditional condition = "$errDictionary.xxx.isError">
<wo:String value = "$errDictionary.xxx.message">
</wo:WOConditional>
<wo:WOTextField value = "$selectedUser.accountName" class = "$errDictionary.xxx.class"/>
</p>


What do I put in xxx? The keypath I get is 'selectedAccount.accountName'.

UPDATE:

After some experiments I found the following works:

"~validationError()[\"selectedUser.accountName\"].isError()"
"~validationError()[\"selectedUser.accountName\"].message()"
"~validationError()[\"selectedUser.accountName\"].class()"

And to access a static field in a class is

"~@com.tofusoft.utils.State@SEARCH"

WHEEEEEEEEEEEEEEEEEEEEEE!

_______________________________________________
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


  • Prev by Date: Re: FOSS Reporting Libraries?
  • Next by Date: Project Wonder Libs missing
  • Previous by thread: [MEET] Chicago CocoaHeads Tuesday Sept. 8
  • Next by thread: Project Wonder Libs missing
  • Index(es):
    • Date
    • Thread