Custom Dynamic Element: get keyPath?
Custom Dynamic Element: get keyPath?
- Subject: Custom Dynamic Element: get keyPath?
- From: Dana Kashubeck <email@hidden>
- Date: Mon, 25 Jul 2005 16:42:56 -0400
- Organization: Riemer Reporting Service Inc.
Okay, I'm probably missing something fundamental here. First off, I'm
using WebObjects 4.5.1, which may or may not be relevant.
What I've done was create a custom Dynamic Element (RRSXTextField). It
basically reimplements WOTextField with a few extras that we've been
wanting.
Obviously, I run values through formatters if necessary. If the value
does not validate, I call validationFailedWithException:value:keyPath:
on the page. I create my own exception, which is passed to the method,
and pass the bad entry as the value. The problem is, I'm not sure how
to get the correct value for keyPath. I see no way to get the keyPath
from the WOAssociation or any other object. Right now I pass the
field's name for keyPath, but I know this is incorrect. Is there any
way to find out what the keyPath is from the WOAssociation?
For instance, with a WOTextField if I have an ivar named fieldName bound
to value and the string "testField" bound to name, in the
validationFailedWithException:value:keyPath method for the page, keyPath
will return fieldName. If I use my custom component, I can only return
"testField" for the keyPath. I'd like to be able to return fieldName --
the name of the ivar.
--
-------------------------------------
Dana Kashubeck
Systems Manager
Riemer Reporting Service Inc.
http://www.riemer.com
Phone: 440-835-2477 x. 125
Fax: 440-835-4594
-------------------------------------
Attachment:
smime.p7s
Description: S/MIME Cryptographic Signature
_______________________________________________
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