title: p:dialog not hidden in html and directly rendered on page
body: <p>I have a <code>p:dialog</code>, which is usually not rendered on the page and when I activate it, it is shown as a popup in a new window.</p>
  
  <pre><code>&lt;p:dialog id="dialogAdressvalidierung"
                header="Adresse auswählen"
                widgetVar="popupAdrValidierung"
                modal="true"
                draggable="true"
                showEffect=""
                hideEffect=""
                width="900"
                resizable="false"
                appendTo="@(body)"&gt;
      &lt;!--dialogs content--&gt;
  &lt;/p:dialog&gt;
  </code></pre>
  
  <p>The html output usually is something like this</p>
  
  <pre><code>&lt;div class="ui-dialog ui-widget ui-widget-content ui-corner-all ui-shadow ui-hidden-container ui-draggable"
       id="dialogAdressvalidierung"
       role="dialog"
       aria-hidden="true"
       aria-labelledby="dialogAdressvalidierung_title"
       style="width: 900px; height: auto;"&gt;
       &lt;!--content--&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p>In one case however, I need to refresh the page on the server.</p>
  
  <pre><code>FacesContext context = FacesContext.getCurrentInstance();
  Application application = context.getApplication();
  ViewHandler viewHandler = application.getViewHandler();
  UIViewRoot viewRoot = viewHandler.createView(context, context.getViewRoot().getViewId());
  context.setViewRoot(viewRoot);
  context.renderResponse();
  </code></pre>
  
  <p>After executing the java code above, all the dialogs in the xhtml files are displayed inside the html and the page looks awfully distorted. Some attributes like <code>aria-hidden="true"</code> and <code>role="dialog"</code> of the <code>div</code> elements, that result from the <code>p:dialog</code> are gone:</p>
  
  <pre><code>&lt;div class="ui-dialog ui-widget ui-widget-content ui-corner-all ui-shadow ui-hidden-container"
       id="dialogAdressvalidierung"&gt;
      &lt;!--content--&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p>Why is the html output of the p:dialog not hidden anymore? How do I get the dialogs to not be shown on the page and still only popup when activated?</p>