Jsf Primefaces命令按钮ajax事件集隐藏对话框
我用的是PrimeFaces5.1。在我的项目命令中,单击按钮打开对话框可以正常工作。在测试操作中,我尝试隐藏对话框,但它不工作 detail.xhtmlJsf Primefaces命令按钮ajax事件集隐藏对话框,jsf,primefaces,Jsf,Primefaces,我用的是PrimeFaces5.1。在我的项目命令中,单击按钮打开对话框可以正常工作。在测试操作中,我尝试隐藏对话框,但它不工作 detail.xhtml <p:commandButton value="test" action="#{stud.testAction}" ajax="false" onclick="PF('waitDialog').show();"/> <p:dialog id="waitDialog" widgetVar="waitDialog"> &
<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>
我怀疑当设置commandButton属性ajax为false时如何隐藏对话框。可能重复的如果您试图下载,可能的重复是正确的嘿,我没有测试您的代码,但我有一个问题。如果您为该方法放置了一个返回字符串,它是否会在方法完成时重新加载页面(这样等待对话框就应该关闭)?
public void testAction()
{
downloadMethod(toList)
RequestContext.getCurrentInstance.execute("PF('waitDialog').hide()");
}