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.