Pass-through bindings from parent to child component
Pass-through bindings from parent to child component
- Subject: Pass-through bindings from parent to child component
- From: Paul Hoadley <email@hidden>
- Date: Thu, 3 Jan 2008 16:18:12 +1030
Hello,
Is there an idiom for passing through _any and all_ bindings from a parent to a child component without being specific about it? This issue is coming up for me in two places where I'm wrapping a Dynamic Element in a parent component. One example is my LSBrowser which wraps a WOBrowser:
1. I want to be able to set any bindings on the WOBrowser which were set on the LSBrowser. I can list them out in the WOD:
browser : WOBrowser { list = ^list; item = ^item; selections = ^selections; displayString = ^displayString; multiple = ^multiple; id = ^id; value = ^value; escapeHTML = ^escapeHTML; selectedValues = ^selectedValues; name = ^name; disabled = ^disabled; size = ^size; class = classList; }
But then WOLips flags an error because I've "set" 'selectedValues' and 'selections'. All I'm trying to express here is that whichever of the two is set on the parent should be passed through to the child.
2. Similarly, I'd like to be able to pass through arbitrary bindings such as 'id' in the list above without having to be specific about it. Although 'id', for example, is not in the API for WOBrowser, WOBrowser will pass that through to the corresponding HTML element. How can I mimic this functionality in my LSBrowser?
|
_______________________________________________
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