title: PrimeFaces dialog lazy loading (dynamic="true") does not work?
body: <p>I have recently changed all my beans from <code>RequestScoped</code> to <code>ViewScoped</code>. Suddenly, the lazy loading of dialogs does not work. I am using <code>PrimeFaces</code> JSF library.</p>
  
  <pre><code>&lt;html&gt;
  &lt;h:body&gt;
  &lt;f:view&gt;    
      &lt;h:form&gt;
          &lt;p:commandButton id="addId" value="Add" title="Add" type="button" onclick="dlgMultiFileSelect.show();"/&gt;
          ...
      &lt;/h:form&gt;    
      &lt;p:dialog header="Dialog" widgetVar="dlgMultiFileSelect" modal="true" resizable="true" dynamic="true"&gt; 
          &lt;ui:include src="/dialogs/media_browser.xhtml"/&gt;
      &lt;/p:dialog&gt;
  &lt;/f:view&gt;   
  &lt;/h:body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>Seems like <code>dynamic="true"</code> does not work since the backing bean in <code>media_browser.xhtml</code> gets initialized immediately, and not when button is clicked. </p>
  
  <p>Am I doing something wrong? </p>
  
  <p>Using PrimeFaces 3.5.0.</p>