从命令按钮调用时,Primefaces 对话框不起作用
Primefaces dialog does not work when it called from commandbutton
我正在将 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
我发现了问题,这是我的模板。由于它是遗留应用程序,"MenuPrincipal.xhtml" 模板一团糟。我创建了一个 template.xhtml 和 composition.xhtml 用于测试,我使用 commandButton 调用对话框并且它起作用了。
我正在将 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
我发现了问题,这是我的模板。由于它是遗留应用程序,"MenuPrincipal.xhtml" 模板一团糟。我创建了一个 template.xhtml 和 composition.xhtml 用于测试,我使用 commandButton 调用对话框并且它起作用了。