Create an eventhandler in your MainMenu component which fires on select and
gives the selected menuitem as context.
For example
class MainMenu
@Inject
private SideMenu sideMenu;
Object onActionFromYourMenu(String context)
{
sideMenu.setSelectedMainMenuItem(context);
return null;
}
class SideMenu
@Property
@Persist
private String selectedMainMenuItem;
@Inject
private Block whateverBlock;
@Property
@Persist
private Block displayBlock;
Object setupRender()
{
if(selectedMainMenuItem.equals("whatever")
displayBlock = whateverBlock;
...
return null;
}
SideMenu.tml
<div class="sidemenu">
<t:delegate to="displayBlock"/>
</div>
<t:block t:id = "whateverBlock">
<ul>
<li>Whatver has to be done</li>
<ul>
</t:block>
2009/6/11 Eldred Mullany <[email protected]>
> Hi All
>
>
>
> I need some advice on how to get two menu components to talk to each
> other. The fist component is a top menu with a whole lot of links, when
> an action link is fired(from the first menu component) I want to pass a
> parameter string to the second component (sub-menu) which will render
> based on the parameter it's been passed to it.
>
>
>
> So in other words second menu component is dependent on the first.
>
>
>
> Its pretty much high level but some advice would be useful. Perhaps a
> component listener of some sort?
>
>
>
> Any ideas ?
>
>
>
> Thanks
>
> Eldred
>
>
>
>