I have a rich:toolBar inwhich when I click on a menuItem, it is supposed to initialize few parameters in my backing bean and then navigate to the respective view page.
Could you let me know how this could be done?
i.e as per code after addNew method is called, the view should be as per navigation rule.
rich:toolBar code is :
<rich:toolBar id="menuBar">
<rich:dropDownMenu>
<f:facet name="label">Menu</f:facet>
<rich:menuItem value="#{msg.menuAddMember}" submitMode="ajax"
action="#{memberBean.addNew}">
</rich:menuItem>
</rich:dropDownMenu>
</rich:toolBar>
and
navigation rule is :
<navigation-rule>
<from-view-id>/common/template.xhtml</from-view-id>
<navigation-case>
<from-action>#{memberBean.addNew}</from-action>
<to-view-id>/pages/addMember.xhtml</to-view-id>
</navigation-case>
</navigation-rule>
Regards,
Satya
That seems to be pretty simple after I figured out how to do that.
I added action aswell as actionListener for the rich:menuItem and it worked as I wanted it to. <
rich:menuItem value="#{msgs.menuAddMember}" action="addMemberAction" actionListener="#{memberBean.addNew}"/>With above code, 1st listener is invoked which will populate dropdown values and then move to view which makes use of those dropdowns.