title: Dynamic page update in nested primefaces layout
body: <p>I am fairly new to JSF and PrimeFaces and have a couple issues in developing a full page layout with multiple menus. </p>
  
  <p>ISSUE #1</p>
  
  <p>We have a full page layout using PrimeFaces 3.3 with nested layout units on the left side as follows: </p>
  
  <pre><code>&lt;p:layoutUnit id="west" position="west" header="Services" resizable="true" closable="true" collapsible="true" effect="drop"&gt;
              &lt;p:layout&gt;                                          
                  &lt;p:layoutUnit id="inner_center" position="center"&gt;                        
                     &lt;h:form id="formMainMenu"&gt;
                          &lt;ui:include src="#{menuBean.pageToDisplay}.xhtml" /&gt;
                     &lt;/h:form&gt;               
                  &lt;/p:layoutUnit&gt;
                  &lt;p:layoutUnit id="inner_south" size="200" position="south"&gt;                                       
                      &lt;h:form id="formStartMenu"&gt;
                          &lt;p:menu&gt;
                              &lt;p:submenu label="Start Menu"&gt;                                    
                                  &lt;p:menuitem value="Start" actionListener="#{#menuBean.setPageToDisplay('template/menu/start')}" update=":inner_center" /&gt;                                    
                              &lt;/p:submenu&gt;
                          &lt;/p:menu&gt;
                      &lt;/h:form&gt;
                  &lt;/p:layoutUnit&gt;
              &lt;/p:layout&gt;
          &lt;/p:layoutUnit&gt;
  </code></pre>
  
  <p></p>
  
  <p>Here is the backing bean: </p>
  
  <pre><code>@ManagedBean(name = "menuBean")
  @SessionScoped
  public class menuBean implements Serializable {
  
  private String pageToDisplay = "template/menu/main";
  
  public String getPageToDisplay() {
      return this.pageToDisplay;
  }
  
  public void setPageToDisplay(String pageToDisplay) {
      this.pageToDisplay = pageToDisplay; 
  } }
  </code></pre>
  
  <p>When I click on the menuItem, the entire LayoutUnit (inner_center) disappears. I have tried numerous combinations of Forms and Panel controls along with Ajax and cannot get the second page and menu to load. Maybe my approach is incorrect due to my limited knowledge in JSF. I am hoping this something simple and I am just missing it.</p>
  
  <p>From a menuItem action, I want to load another PrimeFaces menu bean in the inner_center layout unit.. maybe I don't need to do this and just call the menu via Ajax? </p>
  
  <p>ISSUE # 2
  With these nested layoutunits, when the page loads, the parent LayoutUnit header "Services" disappears completely. </p>
  
  <pre><code>&lt;p:layoutUnit id="west" position="west" header="Services" resizable="true" closable="true" collapsible="true" effect="drop"&gt;
  </code></pre>
  
  <p>Any help or advice on the overall approach is greatly appreciated!! </p>
  
  <p>Thanks!</p>