0

I'm using Primefaces 5.1. In my project commandButton onclick to open the dialog is work fine.Button in testAction I try to hide dialog but it not working.

detail.xhtml

<p:commandButton value="test" action="#{stud.testAction}" ajax="false" onclick="PF('waitDialog').show();"/>

<p:dialog id="waitDialog" widgetVar="waitDialog">
<p:graphicImage url="#{stud.waitImage}"/>
</p:dialog>

detail.java

public void testAction()
{
downloadMethod(toList)
RequestContext.getCurrentInstance.execute("PF('waitDialog').hide()");
}

My doubt how to hide dialog when set commandButton attribute ajax false.

3
  • 2
    Possible duplicate of Execute JavaScript on client side within an non ajax call Commented Jan 23, 2016 at 6:30
  • if you are trying to do a download, the possible duplicate is correct Commented Jan 23, 2016 at 11:02
  • 1
    Hey, I didn't test your code but I got a question on it. If you put a return String for the method doesn't it reload the page upon method completion (so that the wait dialog should be closed anyway) ? Commented Jan 23, 2016 at 22:26

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.