title: Primefaces dynamic overlayPanel showing only once
body: <p>I have a form with a button that opens a Primafaces <code>overlayPanel</code>. 
  In the panel there is another button that performs an Ajax action and then closes the overlay.<br>
  Here is a simplified version with no Ajax action at all:  </p>
  
  <pre><code>&lt;h:form&gt;
      &lt;p:commandButton id="button1" value="Open overlay" type="button"/&gt;
      &lt;p:overlayPanel for="button1" widgetVar="ovl" dynamic="true"&gt;
          &lt;p:commandButton value="Close" oncomplete="ovl.hide();"
                           update="@form"/&gt;
      &lt;/p:overlayPanel&gt;
  &lt;/h:form&gt;
  </code></pre>
  
  <p>Please note that the panel must have <code>dynamic="true"</code> because dynamic content must be fetched in the real application, and <code>update="@form"</code> is needed in order to update other form components. </p>
  
  <p>The problem is: if I have both attibutes, <code>dynamic="true"</code> and <code>update="@form"</code> the overlay shows up only the first time. After clicking the "close" button, if I try to click on "open overlay" once more, the panel won't show up.  </p>
  
  <p>What am I doing wrong?  </p>
  
  <p>(Using PrimeFaces 3.5 and GlassFish 3.1.2.2)</p>