Re: Nested component communication
Re: Nested component communication
- Subject: Re: Nested component communication
- From: Zak Burke <email@hidden>
- Date: Wed, 11 Aug 2004 08:44:35 -0400
David,
Yeah, I've had a hard time tracking down details about inter-component
communication. Here's what works for me: In the api file of the
component which is being wrapped, you can directly set the wrapper's
variables like this:
WebObjectTagName: WrapperComponent {
var1 = "static string value";
var2 = aMethodValue;
}
This assumes that:
* the class WrapperComponent has variables var1 and var2. set-methods
probably work too, but I haven't tried
* the inner component's class has a method aMethodValue()
* var2 and the value returned by aMethodValue() are the same type
In your case, it sounds like you should be able to set the wrapper
class's "tabOne" variable from the wrapped pages, just like setting var1
in the example above.
Good luck --
zak.
David Holt wrote on 8/10/04 6:52 PM:
Hello,
I am trying to get a navigation bar to work so that an image changes
when the user is on the page (like the tabs on Apple's site).
The way I have set it up is to have a page wrapper containing a
WOComponentContent and a NavigationBar Component made up of Rollover
components. In my API for the wrapper I have set a boolean variable
called "tabOne" and for all of the components that fill the
"WOComponentContent" under "tabOne" I have set their "tabOne" binding to
"true".
I have also placed "tabOne" variables in the wrapper component, the
NavigationBar component and the Rollover component. I have wrapped the
rollover button for tabOne in a conditional to display the rollover when
the boolean is false (i.e. not on a page that is in tabOne) and a static
image when the boolean is true. My problem is that the boolean is always
evaluating to false on pages where "tabOne" is true and as a result only
the rollover is displayed in its conditional. From my reading, it seems
that the component communication is automatic from the parent components
to child components so long as the variables are named the same thing.
Am I misunderstanding something about how the communication would occur
from ComponentContent>Wrapper>NavigationBar>Rollover ? If so, what would
be a better way to implement this? Thanks,
David
_______________________________________________
webobjects-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/webobjects-dev
Do not post admin requests to the list. They will be ignored.
_______________________________________________
webobjects-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/webobjects-dev
Do not post admin requests to the list. They will be ignored.