• 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
Re: Pass-through bindings from parent to child component
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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
References: 
 >Pass-through bindings from parent to child component (From: Paul Hoadley <email@hidden>)
 >Re: Pass-through bindings from parent to child component (From: Paul Hoadley <email@hidden>)
 >Re: Pass-through bindings from parent to child component (From: Chuck Hill <email@hidden>)
 >Re: Pass-through bindings from parent to child component (From: Paul Hoadley <email@hidden>)
 >Re: Pass-through bindings from parent to child component (From: Chuck Hill <email@hidden>)

  • Prev by Date: Re: Can't retrieve cookies
  • Next by Date: Re: WOComponent children
  • Previous by thread: Re: Pass-through bindings from parent to child component
  • Next by thread: Class 'Session' exists but is not a subclass of WOSession?
  • Index(es):
    • Date
    • Thread