PrimeFaces对话框从CommandButton调用时不起作用



我正在迁移PrimeFaces版本4.0.rc1至6.2,但是对话框不再起作用。我通过CommandButton

调用对话框

下面,我的标签

<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

我发现了问题,这是我的模板。由于它是一个旧应用程序,因此" menuprincipal.xhtml"模板是一团糟。我为测试创建了一个template.xhtml和composition.xhtml,我使用了调用对话框的命令button。

最新更新