-1

I am migrating the primefaces version 4.0.RC1 to 6.2, but the dialogs does not work anymore. I call the dialogs through the commandbutton

below, my tags

<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"> ...

below javascript console error

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
  • How is this the dialog framework, looks like a normal dialog to me... And please read the documentation of the dialog... Off-topic: https://stackoverflow.com/questions/7415230/uiform-with-prependid-false-breaks-fajax-render – Kukeltje May 06 '19 at 15:23
  • 1
    Possible duplicate of [commandButton/commandLink/ajax action/listener method not invoked or input value not set/updated](https://stackoverflow.com/questions/2118656/commandbutton-commandlink-ajax-action-listener-method-not-invoked-or-input-value) See #16 there – Kukeltje May 06 '19 at 15:23
  • I created a test button () , and it causes the same error in the browser console (statusDialog is not defined) – Gustavo de Freitas May 08 '19 at 13:36
  • Also read https://stackoverflow.com/questions/7415230/uiform-with-prependid-false-breaks-fajax-render, and **always** create a [mcve] – Kukeltje May 08 '19 at 15:57
  • I created a simple screen with the p:commandButton that called the p:dialog and it worked. I believe the error happens because my page is a composition of a template. Has anyone ever made the commandButton call the dialog inside a composition? – Gustavo de Freitas May 08 '19 at 19:12
  • I discovered the problem, it's my template. As it's a legacy application, the "MenuPrincipal.xhtml" template is a mess. I created a template.xhtml and composition.xhtml for test, and I used the commandButton calling the dialog and it worked. – Gustavo de Freitas May 08 '19 at 20:39
  • Instead of asking questions, please do what is requested by us.,. [mvve] – Kukeltje May 08 '19 at 21:43

1 Answers1

-1

I discovered the problem, it's my template. As it's a legacy application, the "MenuPrincipal.xhtml" template is a mess. I created a template.xhtml and composition.xhtml for test, and I used the commandButton calling the dialog and it worked.

  • Great you found it and thanks for letting us know. But honestly, this question and answer are sort of useless for others in the current form. You better remove them or greatly improve both. Cheers – Kukeltje May 08 '19 at 21:39