Re: Passing parameters on a binding
Re: Passing parameters on a binding
- Subject: Re: Passing parameters on a binding
- From: Chuck Hill <email@hidden>
- Date: Thu, 21 Oct 2004 17:26:37 -0700
At 10:13 AM 22/10/2004 +1000, Greg Hulands wrote:
>Hi,
>I have been reading Chuck's book
I guess that would be me. :-)
the last couple of days and have been
>trying to extend his validation solution a bit. What I have done is
>added a method to my super component:
>
> public boolean hasFailedValidationNamed(String key) {
> return validationData.objectForKey(key) != null;
> }
>
>What I want to do is have a WOConditional in the page that can be bound
>to hasFailedValidationNamed and pass it in the key. Is this at all
>possible?
Yes and no. It is not possible with plain old key-value coding. It is
possible using OGNL (ask Google), there is a framework in Project Wonder
(WOOGNL) that wraps the OGNL library up for WO. I like it and it is
powerful, but it does add the potential for the binding version of
spaghetti code. You have been warned.
>Is there a better solution? The main reason I want the
>WOConditional is mainly because of layout problems at the moment.
>
You could make your own version of WOConditional (not very WOBuilder GUI
friendly I am afraid) that takes both a method and a parameter binding.
I'd go for WOOGNL.
Chuck
--
Chuck Hill email@hidden
Global Village Consulting Inc. http://www.global-village.net
_______________________________________________
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