从命令按钮调用时,Primefaces对话框不起作用

时间:2019-05-06 14:31:38

标签: primefaces primefaces-dialog-framework

我正在将Primefaces版本4.0.RC1迁移到6.2,但是对话框不再起作用。我通过命令按钮调用对话框

下面,我的标签

<ui:composition xmlns="http://www.w3.org/1999/xhtml" ...
<ui:define name="corpo-da-pagina">...
<h:form id="form" preprendId="false"> ...
<p:commandButton value="Adicionar" actionListener="#{EnPaisSB.prepararAdicionar}" style="font-size: 10px" oncomplete="PF('man').show();" update="tabela" />...
<p:dialog modal="true" header="Manutencao"  widgetVar="man" resizable="true" width="500" id="dialog" closable="false" appendToBody="true"> ...

在JavaScript控制台错误下方

ReferenceError: statusDialog is not defined[Learn More] TblEnPais.xhtml:139:76
start http://localhost:8080/Enderecamento-web/cadastro/TblEnPais.xhtml:139
trigger http://localhost:8080/Enderecamento-web/javax.faces.resource/core.js.xhtml?ln=primefaces&v=6.2:6
bind http://localhost:8080/Enderecamento-web/javax.faces.resource/core.js.xhtml?ln=primefaces&v=6.2:6
jQuery 7
send http://localhost:8080/Enderecamento-web/javax.faces.resource/core.js.xhtml?ln=primefaces&v=6.2:3
offer http://localhost:8080/Enderecamento-web/javax.faces.resource/core.js.xhtml?ln=primefaces&v=6.2:3
handle http://localhost:8080/Enderecamento-web/javax.faces.resource/core.js.xhtml?ln=primefaces&v=6.2:3
ab http://localhost:8080/Enderecamento-web/javax.faces.resource/core.js.xhtml?ln=primefaces&v=6.2:3
onclick http://localhost:8080/Enderecamento-web/cadastro/TblEnPais.xhtml:1

1 个答案:

答案 0 :(得分:-1)

我发现了问题,这是我的模板。由于它是旧版应用程序,因此“ MenuPrincipal.xhtml”模板是一团糟。我创建了template.xhtml和composition.xhtml进行测试,并使用commandButton调用对话框,它可以正常工作。