If I click on the create User in the left nav the create user form will show up in the center layout unit. If I fill out the information and hit submit, it will add the user to the db fine but will not show the p:growl message that it was successful. If I submit the form again the message will show up and it will submit again to the db. This applies to every view that is populate using the left hand navigation.
My navigation works like this, please disregard any syntax errors as I am not copying and pasting.
layout.xhtml
Code: Select all
<p:layoutUnit position="left" >
<ui:insert name="widgetMenu" />
</p:layoutUnit>
<p:layoutUnit position="center" >
<p:ajaxStatus style="display:none" onstart="loading.show()" onsuccess="loading.hide()" />
<ui:insert name="widgetContent" />
</p:layoutUnit>
Code: Select all
<ui:define name="widgetMenu">
<ui.include src="/'views/menu.xhtml" />
</ui:define>
<ui:define name="widgetContent">
<h:form id="mainView">
<h:panelGroup layout="block" id="viewCreate" rendered="#{bean.menuItem == 'create'}" >
<ui:include src="/views/createUser.xhtml" />
</h:panelGroup>
<h:panelGroup layout="block" id="viewSearch" rendered="#{bean.menuItem == 'search'}" >
<ui:include src="/views/searchUsers.xhtml" />
</h:panelGroup>
</h:form>
</ui:define>
Code: Select all
<h:form id="menuNav">
<p:commandLink action="#{bean.updateMenuItem}" update="mainView">
<f:param name="menuItem" value="create" />
Create User
</p:commandLink>
<p:commandLink action="#{bean.updateMenuItem}" update="mainView">
<f:param name="menuItem" value="search" />
Search Users
</p:commandLink>
</h:form>
Code: Select all
public void updateMenuItem {
this.menuItem = FacesContext.getCurrentInstance().getExternalContext().getRequestParameterMap().get("menuItem");
}