Anônimo | Olá Vinícius,
O seu diálogo ainda tem um pequeno problema, falta o <h:form>. Para que o ajax funcione e necessário ter um form que pode ser dentro ou fora do dialog. O recomendado e que ele fique dentro do Dialog. Veja o exemplo abaixo:
<p:dialog id="modalEvidenciaNew" header="Evidência" widgetVar="dialogEvidenciaNew" modal="true" width="400" height="400" resizable="false" closable="true" appendToBody="true">
<h:form id="detail-form-id"> <!-- seus componentes deverão estar aqui dentro do form--> </h:form>
</p:dialog>
Att,
Estrela Vaz
Em 3 de maio de 2014 15:10, Vinícius Ferneda de Lima < vinicius.ferneda@gmail.com> escreveu:
> Olá. > > Retirei o atributo immediate="true" e coloquei a tah > process="@this,evidenciaNome,evidenciaDescricao", porém continua não > funcionando. > > Segue como ficou o meu código: > > <p:dialog id="modalEvidenciaNew" > header="Evidência" > widgetVar="dialogEvidenciaNew" > modal="true" > width="400" height="400" > resizable="false" > closable="true" > appendToBody="true"> > <h:panelGrid id="panelModalEvidencianew"> > <h:outputLabel value="#{messages['evidencia.label.nome']}: " > for="evidenciaNome" styleClass="text-input" /> > <h:inputText id="evidenciaNome" > value="#{conjuntoEvidenciasEditMB.evidenciaNome}" > title="#{messages['evidencia.alt.nome']}" /> > <p:message for="evidenciaNome" /> > > <h:outputLabel value="#{messages['evidencia.label.descricao']}: " > for="evidenciaDescricao" styleClass="text-input" /> > <h:inputText id="evidenciaDescricao" > value="#{conjuntoEvidenciasEditMB.evidenciaDescricao}" > title="#{messages['evidencia.alt.descricao']}" /> > <p:message for="evidenciaDescricao" /> > <h:panelGrid id="fieldsanexo" columns="1"> > <p:commandButton value="#{messages['button.new']}" > action="#{conjuntoEvidenciasEditMB.addAnexo}" update="listAnexo"/> > <p:dataTable id="listAnexo" var="anexo" > value="#{conjuntoEvidenciasEditMB.anexoList}" rowIndexVar="index"> > > <p:column> > <h:outputLabel value="#{messages['anexo.label.id']}: " for="id" > styleClass="text-input" /> > <h:outputText id="id" value="#{anexo.id}" /> > <p:message for="id" /> > </p:column> > > <p:column> > <h:outputLabel value="#{messages['anexo.label.arquivo']}: " > for="arquivo" styleClass="text-input" /> > <h:inputText id="arquivo" value="#{anexo.arquivo}" > title="#{messages['anexo.alt.arquivo']}" /> > <p:message for="arquivo" /> > </p:column> > > <p:column> > <f:facet name="header">#{messages['label.action']}</f:facet> > <p:commandButton value="#{messages['button.delete']}" > action="#{conjuntoEvidenciasEditMB.deleteAnexo}" ajax="false"/> > </p:column> > </p:dataTable> > </h:panelGrid> > <p:commandButton value="#{messages['button.save']}" > actionListener="#{conjuntoEvidenciasEditMB.setEvidencia()}" > update="panelModalEvidencia" > oncomplete="dialogEvidenciaNew.hide();" > process="@this,evidenciaNome,evidenciaDescricao" > /> > </h:panelGrid> > </p:dialog> > > Att. > > Vinícius Ferneda de Lima. > > > > Olá Vinícius. > > > > Concordo com o Rafael, o seu p:commandButton Salvar está com > > immediate="true" isto quer dizer que > > o *actionListener* será executado em *Process Events* de* > > APPLY_REQUEST_VALUES,* sendo assim o > > nome e a descrição estão nulos, porque o modelo não foi atualizado. > Depois > > que o actionListener foi executado, > > o ciclo seguiu para *RENDER_RESPONSE* e nunca chegou em > > *UPDATE_MODEL_VALUES*. > > > > > > Estou enviando os códigos abaixo para que você possa acompanhar o ciclo > de > > vida da JSF isto ajuda bastante no momento do debug. > > > > > > > > import javax.faces.event.PhaseEvent; > > import javax.faces.event.PhaseId; > > > > public class CicloDeVidaJSFListener implements > > javax.faces.event.PhaseListener { > > > > private static final long serialVersionUID = 1L; > > > > @Override > > public void afterPhase(PhaseEvent event) { > > System.out.println("END PHASE "+event.getPhaseId()); > > } > > > > @Override > > public void beforePhase(PhaseEvent event) { > > System.out.println("START PHASE "+event.getPhaseId()); > > } > > > > @Override > > public PhaseId getPhaseId() { > > return PhaseId.ANY_PHASE; > > } > > } > > > > > > E adicione as seguintes linhas no *faces-config.xml* para ativar o > > CicloDeVidaJSFListener . > > > > <lifecycle> > > > > > <phase-listener>seu.pacote.CicloDeVidaJSFListener</phase-listener></lifecycle> > > > > > > > > > > > > Em 1 de maio de 2014 22:23, Rafael Odon <odon.rafael@gmail.com> > escreveu: > > > > > Seu botão Salvar está com immediate="true", logo irá direto para a fase > > de > > > invocação de aplicação, sem passar pelo processamento de validações e > > > atualização do modelo. > > > > > > Passe para false ou retire essa propriedade. Utilize o atributo > process e > > > informe os id's dos campos que devem ser processados por esse botão > ajax, > > > vai ficar algo assim: process="@this,nome,descricao" > > > > > > Até+ > > > > > > > > > 2014-05-01 22:17 GMT-03:00 Vinícius Ferneda de Lima < > > > vinicius.ferneda@gmail.com>: > > > > > > > Olá jovens. > > > > > > > > Estou enfrentando um problema na utilização do componente <p:dialog> > > para > > > > gravação de registros. > > > > > > > > Quando clico no botão que chama o método "setEvidencia()" no meu > > > ManageBean > > > > as informações de "nome" e "descrição" do objeto "EvidenciaAux" estão > > > > nulas. > > > > > > > > O que posso fazer para o que foi informado nos campos em tela seja > > > > atribuído ao objeto? > > > > > > > > Segue o dialog: > > > > > > > > <!--Código--> > > > > > > > > <p:dialog id="modalEvidenciaNew" > > > > header="Evidência" > > > > widgetVar="dialogEvidenciaNew" > > > > modal="true" > > > > width="400" height="400" > > > > resizable="false" > > > > closable="true" > > > > appendToBody="true"> > > > > <h:panelGrid id="panelModalEvidencianew"> > > > > <h:outputLabel value="#{messages['evidencia.label.nome']}: " > for="nome" > > > > styleClass="text-input" /> > > > > <h:inputText id="nome" > > > > value="#{conjuntoEvidenciasEditMB.bean.evidenciaAux.nome}" > > > > title="#{messages['evidencia.alt.nome']}" /> > > > > <p:message for="nome" /> > > > > > > > > <h:outputLabel value="#{messages['evidencia.label.descricao']}: " > > > > for="descricao" styleClass="text-input" /> > > > > <h:inputText id="descricao" > > > > value="#{conjuntoEvidenciasEditMB.bean.evidenciaAux.descricao}" > > > > title="#{messages['evidencia.alt.descricao']}" /> > > > > <p:message for="descricao" /> > > > > <p:commandButton value="#{messages['button.save']}" > > > > actionListener="#{conjuntoEvidenciasEditMB.setEvidencia()}" > > > > immediate="true" > > > > update="panelModalEvidencia" > > > > oncomplete="dialogEvidenciaNew.hide();" > > > > /> > > > > </h:panelGrid> > > > > </p:dialog> > > > > > > > > <!--Codigo--> > > > > > > > > Att. > > > > > > > > Vinícius Ferneda de Lima. > > > > > > > > > > > > > > ------------------------------------------------------------------------------ > > > > "Accelerate Dev Cycles with Automated Cross-Browser Testing - For > FREE > > > > Instantly run your Selenium tests across 300+ browser/OS combos. Get > > > > unparalleled scalability from the best Selenium testing platform > > > available. > > > > Simple to use. Nothing to install. Get started now for free." > > > > http://p.sf.net/sfu/SauceLabs > > > > _______________________________________________ > > > > > > > > Portal: http://www.frameworkdemoiselle.gov.br > > > > Foruns: http://forum.frameworkdemoiselle.gov.br > > > > Tracker: http://tracker.frameworkdemoiselle.gov.br > > > > _______________________________________________ > > > > > > > > Para editar sua assinatura: > > > > https://lists.sourceforge.net/lists/listinfo/demoiselle-users > > > > > > > > > > > > > ------------------------------------------------------------------------------ > > > "Accelerate Dev Cycles with Automated Cross-Browser Testing - For FREE > > > Instantly run your Selenium tests across 300+ browser/OS combos. Get > > > unparalleled scalability from the best Selenium testing platform > > available. > > > Simple to use. Nothing to install. Get started now for free." > > > http://p.sf.net/sfu/SauceLabs > > > _______________________________________________ > > > > > > Portal: http://www.frameworkdemoiselle.gov.br > > > Foruns: http://forum.frameworkdemoiselle.gov.br > > > Tracker: http://tracker.frameworkdemoiselle.gov.br > > > _______________________________________________ > > > > > > Para editar sua assinatura: > > > https://lists.sourceforge.net/lists/listinfo/demoiselle-users > > > > > > > > > ------------------------------ > > > > > > > ------------------------------------------------------------------------------ > > "Accelerate Dev Cycles with Automated Cross-Browser Testing - For FREE > > Instantly run your Selenium tests across 300+ browser/OS combos. Get > > unparalleled scalability from the best Selenium testing platform > available. > > Simple to use. Nothing to install. Get started now for free." > > http://p.sf.net/sfu/SauceLabs > > > > ------------------------------ > > > > _______________________________________________ > > demoiselle-users@lists.sourceforge.net > > https://lists.sourceforge.net/lists/listinfo/demoiselle-users > > http://www.frameworkdemoiselle.gov.br > > Foruns: http://sf.net/apps/phpbb/demoiselle > > Tracker: http://sf.net/mantisbt/phpbb/demoiselle > > > > Fim da Digest demoiselle-users, volume 466, assunto 1 > > ***************************************************** > > > > ------------------------------------------------------------------------------ > "Accelerate Dev Cycles with Automated Cross-Browser Testing - For FREE > Instantly run your Selenium tests across 300+ browser/OS combos. Get > unparalleled scalability from the best Selenium testing platform available. > Simple to use. Nothing to install. Get started now for free." > http://p.sf.net/sfu/SauceLabs > _______________________________________________ > > Portal: http://www.frameworkdemoiselle.gov.br > Foruns: http://forum.frameworkdemoiselle.gov.br > Tracker: http://tracker.frameworkdemoiselle.gov.br > _______________________________________________ > > Para editar sua assinatura: > https://lists.sourceforge.net/lists/listinfo/demoiselle-users > ------------------------------------------------------------------------------ "Accelerate Dev Cycles with Automated Cross-Browser Testing - For FREE Instantly run your Selenium tests across 300+ browser/OS combos. Get unparalleled scalability from the best Selenium testing platform available. Simple to use. Nothing to install. Get started now for free." http://p.sf.net/sfu/SauceLabs _______________________________________________
Portal: http://www.frameworkdemoiselle.gov.br Foruns: http://forum.frameworkdemoiselle.gov.br Tracker: http://tracker.frameworkdemoiselle.gov.br _______________________________________________
Para editar sua assinatura: https://lists.sourceforge.net/lists/listinfo/demoiselle-users |