I have a form with a button that opens a Primafaces overlayPanel
.
In the panel there is another button that performs an Ajax action and then closes the overlay.
Here is a simplified version with no Ajax action at all:
<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 fetched in the real application, and update="@form"
is needed in order to update other form components.
The problem is: if I have both attibutes, dynamic="true"
and update="@form"
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.
What am I doing wrong?
(Using PrimeFaces 3.5 and GlassFish 3.1.2.2)
Use onclick="widgetVar.loadContents()"
in the button dropping down the overlaypanel
, where widgetVar
is the var of the overlayPanel
.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With