Re: Pass-through bindings from parent to child component
Re: Pass-through bindings from parent to child component
- Subject: Re: Pass-through bindings from parent to child component
- From: Paul Hoadley <email@hidden>
- Date: Thu, 10 Jan 2008 17:22:40 +1030
Hi Chuck,
On 08/01/2008, at 4:38 AM, Chuck Hill wrote:
It if is sufficiently static, you could put it in an NSDictionary in
application, keyed on the element name. Then you could use a
binding on WOBrowser like
application.cssClassesFor.WOBrowser;
where cssClassesFor is a public method on Application that returns
an NSDictionary.
Another thing to consider is to override this method on Application:
public WOElement dynamicElementWithName(String aName,
NSDictionary someAssociations,
WOElement anElement,
NSArray aLanguageArray)
and add your class = whatever binding to the someAssociations
dictionary like so:
if ( someAssociations.objectForKey("class") == null) {
NSMutableDictionary associations = someAssociations.mutableClone();
associations.setObjectForKey(new
WOKeyValueAssociation("application.cssClassesFor.WOBrowser"),
"class");
}
That way, you can override the classes on the element, but it you do
not specify the class then you get the default.
I've used both of these suggestions---a much better way of achieving
what I was trying to do. Thanks.
--
Paul.
w http://logicsquad.net/
h http://paul.hoadley.name/
_______________________________________________
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