title: how to load content on an iframe using a primefaces dynamic menu?
body: <p>I´ve a page where I load my content:</p>
  
  <pre><code>  &lt;?xml version="1.0" encoding="UTF-8"?&gt;
  &lt;!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" 
      "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"&gt;
  &lt;html xmlns="http://www.w3.org/1999/xhtml"   
        xmlns:h="http://java.sun.com/jsf/html"
        xmlns:ui="http://java.sun.com/jsf/facelets"
        &gt;
      &lt;h:head&gt;
          &lt;meta charset="UTF-8"/&gt;
          &lt;title&gt;Dashboard&lt;/title&gt;
          &lt;link rel="stylesheet" type="text/css" href="../css/graficas1_estilos.css" media="all" /&gt;           
      &lt;/h:head&gt;
      &lt;h:body&gt;
          &lt;div id="page"&gt;
              &lt;div id="header"&gt;
                  &lt;ui:insert name="header" &gt;
                      &lt;ui:include src="Header.xhtml" /&gt;
                  &lt;/ui:insert&gt;
              &lt;/div&gt;
              &lt;div id="left"&gt;
                  &lt;ui:insert name="left" &gt;
                      &lt;ui:include src="Left.xhtml" /&gt;
                  &lt;/ui:insert&gt;
              &lt;/div&gt;
              &lt;div id="content"&gt;
                  &lt;ui:insert name="content" &gt;
                       &lt;iframe scrolling="auto" height="100%" frameborder="0" width="100%" 
                       src="Content.xhtml" name="iFrameMain" id="iFrameMain" pane="center"&gt;    
                       &lt;/iframe&gt;
                  &lt;/ui:insert&gt;
              &lt;/div&gt;
              &lt;div id="footer"&gt;
                  &lt;ui:insert name="footer" &gt;
                      &lt;ui:include src="Footer.xhtml" /&gt;
                  &lt;/ui:insert&gt;
              &lt;/div&gt;
          &lt;/div&gt;
      &lt;/h:body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>and on my Left.xhtml I´ve my dynamic menu:</p>
  
  <pre><code>&lt;ui:composition&gt;
               &lt;h:form id="dash2"&gt;  
           &lt;div class="menu_izquierda"&gt;
                           &lt;p:panelMenu id="menuDinamico" model="#{usuariosMB.model}" style="width:200px" styleClass="leftMenu" /&gt;
                         &lt;/div&gt;
               &lt;/h:form&gt;      
      &lt;/ui:composition&gt;
  </code></pre>
  
  <p>Finally to build my menu in my managed bean I add:</p>
  
  <pre><code>MenuModel model = new DefaultMenuModel();
  DefaultSubMenu inicioMenu = new DefaultSubMenu(Constantes.Inicio);
  model.addElement(inicioMenu);
  DefaultMenuItem itemD = new DefaultMenuItem(Constantes.Dashboard);
  itemD.setOutcome(Constantes.outcome);
  inicioMenu.addElement(itemD);
  </code></pre>
  
  <p>So when I click on a link it reloads the entire page.
  What should I do in so only the iframe get´s reloaded after clicking on a menu link???
  Thanks in advance.</p>