rich:panelMenu
krzysgdynia Oct 20, 2007 7:55 AMI want to use panelMenu to navigate between pages. I have a problem with passing active item in panelMenu after page is rendered.
I tried to use:
- selectedChild (in panelMenu component)
- name (in panelMenuGroup and panelMenuItem components)
- and Stateful bean to remember active item
but it doesn't work.
I use Seam2.0.0CR2.
Below are details:
<rich:panelMenu style="width: 100%; width:200px; "
iconExpandedGroup="disc" iconCollapsedGroup="disc"
iconExpandedTopGroup="chevronUp" iconGroupTopPosition="right"
iconCollapsedTopGroup="chevronDown" iconCollapsedTopPosition="right"
rendered="#{identity.loggedIn}" selectedChild="#{menuRend.activeItem}" expandSingle="true">
<rich:panelMenuGroup label="#{msg['view.miasta.title']}" name="miasta">
<rich:panelMenuItem label="#{msg['view.miasta.dodaj']}" action="#{menuRend.addMiasto}" name="addMiasto"/>
<rich:panelMenuItem label="#{msg['view.miasta.lista']}" action="#{menuRend.showMiasta}" name="showMiasta"/>
</rich:panelMenuGroup>
<rich:panelMenuGroup label="#{msg['view.jednostki.title']}" name="jednostki">
<rich:panelMenuItem label="#{msg['view.jednostki.dodaj']}" action="#{menuRend.addJednostka}" name="addJednostka"/>
<rich:panelMenuItem label="#{msg['view.jednostki.lista']}" action="#{menuRend.showJednostki}" name="showJednostki"/>
</rich:panelMenuGroup>
<rich:panelMenuGroup label="#{msg['view.organProwadzacy.title']}" name="organProwadzacy">
<rich:panelMenuItem label="#{msg['view.organProwadzacy.dodaj']}" action="#{menuRend.addOrganProwadzacy}" name="addOrganProwadzacy"/>
<rich:panelMenuItem label="#{msg['view.organProwadzacy.lista']}" action="#{menuRend.showOrganyProwadzace}" name="showOrganyProwadzace"/>
</rich:panelMenuGroup>
</rich:panelMenu>
@Name("menuRend")
@Stateful
public class MenuRendering implements IMenuRendering {
private String activeItem;
public String getActiveItem() {
return activeItem;
}
public String showMiasta(){
this.activeItem = "showMiasta";
return "/miasta/MiastaList.xhtml";
}
public String addMiasto(){
this.activeItem = "addMiasto";
return "/miasta/MiastaEdit.xhtml";
}
public String showJednostki() {
this.activeItem = "showJednostki";
return "/jednostki/JednostkiList.xhtml";
}
public String addJednostka() {
this.activeItem = "addJednostka";
return "/jednostki/JednostkiEdit.xhtml";
}
.........
}
Thanks for the help
Chris