I created a menubar and i want it it all my pages throughout application.When i include the file in other through the menubar state(i.e the submenu is unfolder) dosent maintain.So i created a panel and on click only the pagecontent get refreshed and the menu remain stable.The link dosent change i.e my main page is menubar on click of menu1 also my url is menubar only .
<h:panelGrid columns="2">
<h:panelGroup id="menu" layout="block">
<h:form id= "form">
<h:outputStylesheet name="css/primefaces.css" />
<p:growl id="messages" autoUpdate="true" />
<p:panelMenu style="width:200px " styleClass="ui-menubar"
autoSubmenuDisplay="true">
<p:submenu label="Ajax Menuitems">
<p:menuitem value="Menu1" action ="#{menuBar.setPage('menu1.xhtml')}" />
</p:submenu>
</p:panelMenu>
</h:form>
</h:panelGroup>
<h:panelGroup id="content" layout="block" >
<form id = "contentform">
<ui:include src="#{menuBar.page}" />
</form>
</h:panelGroup>
</h:panelGrid>
<h:panelGroup id="footer" layout="block">
<h1>Footer</h1>
</h:panelGroup>
Whether there is any alternate ways other than this?