title: Primefaces - using dialogs and layouts
body: <p>I have a (JSF 2.0/ Primefaces 2.2RC-SNAPSHOT) app that has </p>
  
  <pre><code> &lt;p:layout&gt; 
  </code></pre>
  
  <p>I use a lot of dialog in my application and before the newest version of primefaces came out there was no way to display a dialog with a modal on top of the layout without putting the dialogs outside of the  tags. </p>
  
  <p>So I did just that. The issue I am having now is I am noticing that constructors and postcontructs are being called when my application is loaded. This is because the view with the layout is being loaded and therefore all my dialogs are being loaded. </p>
  
  <p>I don't want these constructors being called until I am actually dealing with the appropriate views in my application.</p>
  
  <p>I have been testing the appendToBody attribute on the</p>
  
  <pre><code> &lt;p:dialog&gt; 
  </code></pre>
  
  <p>tag but it seems really buggy. Everything works fine on the initial rendering of a view. I can open a dialog close it etc and it works fine. If I navigate away to another view and then come back to the initial view and open the dialog, everything is running off the page. The dialog window is in the correct place but the content is not.</p>
  
  <p>My question is 1. Is there a way I can have the dialog windows outside of my layout as a child of the </p>
  
  <pre><code> &lt;h:body&gt;
  </code></pre>
  
  <p>without having all the managed bean constructors associated with them initiated when the application loads? </p>
  
  <p>Or does anyone know how to fix the alignment issue when using the appendToBody tag? Thanks.</p>