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

"[email protected]@SEARCH"

WHEEEEEEEEEEEEEEEEEEEEEE!

_______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list      ([email protected])
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/webobjects-dev/archive%40mail-archive.com

This email sent to [email protected]

Reply via email to