1
votes

I have a <p:dialog dynamic="true"> which is shown on start of <p:commandButton>.

<h:form id="form">
    <p:commandButton value="#{bundleComunes.guardar}" actionListener="#{saveBB.save}" onstart="PF('saveDialog').show()" update="@form" oncomplete="PF('saveDialog').hide()" />  
    <p:dialog dynamic="true" widgetVar="saveDialog">  
        Guardando<br></br> 
        <p:graphicImage value="/img/ajaxloadingbar.gif" />
    </p:dialog>
</h:form>

It shows dialog, but never hides on complete. But if I remove dynamic="true", it works.

2

2 Answers

1
votes
<h:form>
    <p:commandButton ... update="@form" />
    <p:dialog dynamic="true">  
        ...
    </p:dialog>
</h:form>

You're updating the form the dynamic dialog is sitting in, causing it to get corrupted because it's after the update not the same dialog anymore as when it was opened.

Change update="@form" to something more specific which does not cover the dialog, or, better yet, move the dialog outside the form, preferably to the very bottom of the body.

<h:form>
    <p:commandButton ... update="@form" />
</h:form>
...
<p:dialog dynamic="true">  
    ...
</p:dialog>
0
votes

I have just tested it on glassfish and it works fine.
I think you should have a look on #{saveBB.save} and check if it throws any exception.