title: Close primefaces dialog from iFrame
body: <p>I've a page on which I want to show a dialog.</p>
  
  <p>Code :</p>
  
  <p>page1.xhtml</p>
  
  <pre><code>&lt;p:commandLink value="Show Dialog" oncomplete="dlgWVar.show();"/&gt;
  &lt;p:dialog widgetVar="dlgWVar"
            width="800"
            id="dialog"
            position="top"
            modal="true"
            header="Test Dialog"
            height="500"&gt;
  
      &lt;iframe src="page2.xhtml" width="100%" height="500px" style="border-width: 0PX;"&gt;
      &lt;/iframe&gt;
  
  &lt;/p:dialog&gt;
  </code></pre>
  
  <p>Now on this dialog I've iFrame in which the page2.xhtml is linked.</p>
  
  <p>page2.xhtml</p>
  
  <pre><code>   &lt;p:commandButton value ="Close Dialog"&gt;
     &lt;/p:commandButton&gt;
  </code></pre>
  
  <p>page2.xhtml contains a commandButton. Now I've to close the dialog after clicking the commandButton.</p>
  
  <p>Don't know how to do that.
  What should I write in commandButton on page2.xhtml so that the dialog on page1.xhtml will be closed. Please help.</p>
  
  <p>Thanks.</p>