Time for action – displaying an overlay menu with trigger
Let us see how we can create a menu that will be displayed on clicking a button, by performing the following step:
- Create an overlay menu and define a trigger component to show it:
<p:commandButton id="overlayBtn" value="ShowMenu" type="button"/> <p:menu overlay="true" trigger="overlayBtn" my="left top" at="right bottom"> <p:menuitem value="System Config" outcome="menu"/> <p:submenu label="User Management" > <p:menuitem value="View Users" actionListener="#{menuController.showUserManagement()}"/> <p:menuitem value="Monitor User Activity" actionListener="#{menuController.showUserActivity()}" ajax="false"/> </p:submenu> <p:submenu label="Tag Management"> <p:menuitem value="View...