I have a form with a button that opens a Primafaces overlayPanel . There is another button on the panel that performs an Ajax action and then closes the overlay.
Here is a simplified version without Ajax action:
<h:form> <p:commandButton id="button1" value="Open overlay" type="button"/> <p:overlayPanel for="button1" widgetVar="ovl" dynamic="true"> <p:commandButton value="Close" oncomplete="ovl.hide();" update="@form"/> </p:overlayPanel> </h:form>
Please note that the panel must have dynamic="true" , because dynamic content must be selected in the real application, and update="@form" necessary to update other components of the form.
Problem: if I have both attributes, dynamic="true" and update="@form" , the overlay only appears for the first time. After clicking the “close” button, if I try to click “open overlay” again, the panel will not appear.
What am I doing wrong?
(Using PrimeFaces 3.5 and GlassFish 3.1.2.2)
yankee
source share