Boa noite galera, estou precisando da ajuda de vocês, urgente.
Bom, tenho um index.xhtml que chama outra pagina xhtml e abre apenas o dialog, esse dialog chama outra pagina xhtml e chama outro dialog(rsrs). Então clico no botão salvar e ele simplismente não faz nada. Vou mandar o codigo para vocês.
index.xtml:
<?xml version='1.0' encoding='UTF-8' ?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><htmlxmlns="http://www.w3.org/1999/xhtml"xmlns:h="http://java.sun.com/jsf/html"xmlns:p="http://primefaces.org/ui"xmlns:ui="http://java.sun.com/jsf/facelets"><h:head><title> Sistema Geral</title></h:head><h:form><p:menutype="tiered"position="butom"style="width: 180px"><p:submenulabel="Cadastro"><p:menuitemvalue="País"onclick="dlgGERSRPAI.show()"/></p:submenu></p:menu><ui:includesrc="paginas/GERAL/GERSRPAI.xhtml"/></h:form></html>
GERSRPAI.xhtml:
<?xml version='1.0' encoding='UTF-8' ?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><htmlxmlns="http://www.w3.org/1999/xhtml"xmlns:h="http://java.sun.com/jsf/html"xmlns:p="http://primefaces.org/ui"xmlns:ui="http://java.sun.com/jsf/facelets"><ui:composition><ui:includesrc="GERPRPAI.xhtml"/><h:formid="frmGERSRPAI"><p:dialogheader="Países cadastrados"widgetVar="dlgGERSRPAI"width="570"height="400"minimizable="true"closable="false"resizable="false"><p:commandLink><p:graphicImagevalue="/imagens/novo.png"onclick="dlgGERPRPAI.show()"style="border: none;"update="dlgGERPRPAI"/></p:commandLink><p:commandLink><p:graphicImagevalue="/imagens/editar.png"style="border: none;"/></p:commandLink><p:commandLink><p:graphicImagevalue="/imagens/excluir.png"style="border: none;"/></p:commandLink><p:commandLink><p:graphicImagevalue="/imagens/relatorio.png"style="border: none;"/></p:commandLink><p:commandLink><p:graphicImagevalue="/imagens/fechar.png"onclick="dlgGERSRPAI.hide()"style="border: none;"/></p:commandLink></p:dialog></h:form></ui:composition></html>
GERPRPAI.xhtml
<?xml version="1.0" encoding="ISO-8859-1" ?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><htmlxmlns="http://www.w3.org/1999/xhtml"xmlns:h="http://java.sun.com/jsf/html"xmlns:p="http://primefaces.org/ui"xmlns:ui="http://java.sun.com/jsf/facelets"><head><metahttp-equiv="Content-Type"content="text/html; charset=ISO-8859-1"/></head><p:dialogheader="Países cadastrados"widgetVar="dlgGERPRPAI"width="570"minimizable="true"closable="false"resizable="false"><h:panelGridcolumns="1"><h:outputTextvalue="Código"/><p:inputTextvalue="#{beanGERTBPAI.GERTBPAI.GER_PK_COD_PAI}"style="width: 50px"disabled="true"/><p:separatorstyle="width: 530px"/><h:outputTextvalue="Nome"/><p:inputTextvalue="#{beanGERTBPAI.GERTBPAI.GER_NOME_PAI}"/></h:panelGrid><center><p:commandButtonvalue="Salvar"type="submit"actionListener="#{beanGERTBPAI.salvar}"/><p:commandButtonvalue="Cancelar"onclick="dlgGERPRPAI.hide()"/></center></p:dialog></html>
Quando abro o ultimo dialog ele não executa o metodo salvar. Por que ?
Abraços.
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><htmlxmlns="http://www.w3.org/1999/xhtml"xmlns:h="http://java.sun.com/jsf/html"xmlns:f="http://java.sun.com/jsf/core"xmlns:ui="http://java.sun.com/jsf/facelets"xmlns:sec="http://www.springframework.org/security/facelets/tags"xmlns:p="http://primefaces.org/ui"><ui:compositiontemplate="/templates/templatePrincipal.xhtml"><ui:definename="corpo"><h:formid="formPessoaJuridica"><p:wizardwidgetVar="wiz"id="wizardPessoaJuridica"flowListener="#{pessoaJuridicaBeanView.onFlowProcess}"><p:tabtitle="Pessoa Jurídica"><p:panelheader="Dados Pessoais"id="panelDadosPj"><p:messagesshowDetail="true"id="error"redisplay="true"/><h:panelGridcolumns="2"id="gridPessoaJuridica"><h:outputLabelfor="id"value="Código : "id="labelIdPj"/><p:inputTextid="id"styleClass="estiloIdCastro"value="#{pessoaJuridicaBeanView.pessoaJuridica.id}"disabled="true"/><h:outputLabelfor="nome"value="Nome * : "id="nomePj"/><p:inputTextid="nome"maxlength="80"value="#{pessoaJuridicaBeanView.pessoaJuridica.nome}"required="true"requiredMessage="Informe o nome."styleClass="estyleInputName"/><h:outputLabelfor="sexo"value="Sexo * :"id="labelSexoPf"/><p:selectOneMenuid="sexo"styleClass="styleComboBox"value="#{pessoaJuridicaBeanView.pessoaJuridica.sexo}"required="true"requiredMessage="Informe o campo sexo."><f:selectItemitemValue=""itemLabel="[Selecione]"/><f:selectItemitemValue="Masculino"itemLabel="Masculino"/><f:selectItemitemValue="Feminino"itemLabel="Feminino"/></p:selectOneMenu><h:outputLabelvalue="Email :"for="email"/><p:inputTextid="email"maxlength="50"value="#{pessoaJuridicaBeanView.pessoaJuridica.email}"required="false"styleClass="estyleInputName"><f:validateRegexpattern="[a-zA-Z0-9\-\_\.]+@[a-zA-Z0-9\-\_\.]+"/></p:inputText><h:outputLabelvalue="Ativo :"for="ativo"/><p:selectBooleanCheckboxid="ativo"value="#{pessoaJuridicaBeanView.pessoaJuridica.ativo}"/></h:panelGrid></p:panel></p:tab><p:tabtitle="Dados Jurídicos"><p:panelheader="Dados"id="panelDadosJuridicos"><h:panelGridcolumns="2"columnClasses="label, value"id="gridDadosJuridico"><h:outputLabelfor="cnpj"value="CNPJ * :"/><p:inputMaskmask="99.999.999/9999-99"id="cnpj"value="#{pessoaJuridicaBeanView.pessoaJuridica.cnpj}"required="true"requiredMessage="Informe o Cnpj."/><h:outputLabelfor="inscEstadual"value="Incrição Estadual * :"/><p:inputTextid="inscEstadual"value="#{pessoaJuridicaBeanView.pessoaJuridica.inscEstadual}"required="true"requiredMessage="Informe a Inscrição Estadual."/><h:outputLabelfor="razaoSocial}"value="Razão Social * :"/><p:inputTextid="razaoSocial"value="#{pessoaJuridicaBeanView.pessoaJuridica.razaoSocial}"required="true"requiredMessage="Informe a Razão Social."/><h:outputLabelfor="nomeFantasia"value="Incrição Estadual * :"/><p:inputTextid="nomeFantasia"value="#{pessoaJuridicaBeanView.pessoaJuridica.nomeFantasia}"required="true"requiredMessage="Informe o Nome Fantasia."/></h:panelGrid></p:panel></p:tab><p:tabtitle="Endereço"><p:panelheader="Endereço"id="panelEndereco"><p:panelGridcolumns="3"columnClasses="label, value"id="gripEndereco"><h:outputLabelfor="cidade"value="Cidade * :"id="labelCidade"/><p:inputTextid="cidade"required="true"requiredMessage="Informe a Cidade."disabled="true"value="#{pessoaJuridicaBeanView.pessoaJuridica.endereco}"/><p:commandButtonvalue="Pesquisar"update="formDialogFindCidade"oncomplete="dialogCidade.show()"/></p:panelGrid></p:panel></p:tab></p:wizard><p:dialogwidgetVar="dialogCidade"modal="false"id="dialoFindCidade"header="Consulta de Cidades"resizable="false"><h:formid="formDialogFindCidade"onsubmit="true"><h:panelGridid="gridCidade"columns="3"><h:outputLabelid="labelNomeConsultaCidade"for="cidadeNome"value="Nome * :"/><p:inputTextid="cidadeNome"value="#{pessoaJuridicaBeanView.nomeCidade}"required="true"immediate="true"requiredMessage="Informe o nome da cidade para consulta."/><p:commandButtonid="pesquisarCidade"value="Pesquisar"ajax="true"update="tableCidadeFind"action="#{pessoaJuridicaBeanView.findCityByName}"/></h:panelGrid><p:dataTablevalue="#{pessoaJuridicaBeanView.cidades}"var="cidade"id="tableCidadeFind"paginatorPosition="bottom"paginator="true"paginatorTemplate=" {FirstPageLink} {PreviousPageLink} {PageLinks} {NextPageLink} {LastPageLink} {RowsPerPageDropdown}"rowsPerPageTemplate="10,20,30"><p:column><center><f:facetname="header">Nome</f:facet><h:outputTextvalue="#{cidade.nome}"/></center></p:column></p:dataTable></h:form></p:dialog></h:form></ui:define></ui:composition></html>
o Dialog está aqui no final
alexfe
Agora consegui chamar o metódo usando h:commandButton do JSF , com o commandButton do primeFaces não consegui, mas surgiu outro problema o valor do inputTextField que está no dialog não é setado para o ManagedBean.
H
henriquejhc
Se eu fosse você, eu usaria um actionListener ao invés de uma action.
Faz um teste. Não esqueça de alterar o método findCityByName() para findCityByName(ActionEvent event) .
alexfe
henriquejhc:
Se eu fosse você, eu usaria um actionListener ao invés de uma action.
Faz um teste. Não esqueça de alterar o método findCityByName() para findCityByName(ActionEvent event) .