Olá a todos, meu problema é com atualização de componentes na tela, resumindo, na pagina de alteração dos dados cadastrais, dentro de um <h:form> tenho um <p:tabView> com algumas <p:tab>, a primeira e a segunda aba funcionam normal, nao possuem nada além de inputtext e outputtext, a terceira para telefones, é um pouco mais elaborada, segue código abaixo, ela serve para alterar ou excluir telefones…[code]<h:form id=“frmPrincipal” prependId=“true”>
<h:panelGrid columns=“2” cellspacing=“1px”>
<p:tabView id=“abasAlterarCadastro” style=“height: 400px;width: 650px;”>
aqui tem as outras abas
<p:tab id=“abaTelefones” title=“Telefones”>
<h:panelGroup id=“dadosTelefones”>
<h:outputLabel value=“Tipo: " style=“font-size: 11px”/>
|
<h:selectOneMenu id=“tipos”
value=”#{alterarGaragem.idTipoTelefoneSelecionado}"
style=“width: 80px;font-size: 11px”>
<f:selectItems value="#{alterarGaragem.listaTipoTelefone}" />
</h:selectOneMenu>
|
<h:outputLabel value=“Ddd: " style=“font-size: 11px”/>
|
<p:inputMask mask=“999” value=”#{alterarGaragem.telefoneInserir.ddd}" style=“width: 25px;font-size: 11px”/>
|
<h:outputLabel value=“Número: " style=“font-size: 11px”/>
|
<p:inputMask mask=“9999-9999” value=”#{alterarGaragem.telefoneInserir.numero}" style=“width: 55px;font-size: 11px”/>
|
<h:outputLabel value=“Ramal: " style=“font-size: 11px”/>
|
<p:inputMask mask=“9999” value=”#{alterarGaragem.telefoneInserir.ramal}" style=“width: 30px;font-size: 11px”/>
|
<h:outputLabel value=“Contato: " style=“font-size: 11px”/>
|
<p:inputText value=”#{alterarGaragem.telefoneInserir.contato}" style=“width: 183px;font-size: 11px”/>
|
</table>
<style>
#botaoInserir {
float: right;
padding: 0px;
width: auto;
height: auto;
}
</style>
<table width="100%">
<tr>
<td>
<div id="botaoInserir" >
<p:commandButton value="Adicionar"
actionListener="#{alterarGaragem.inserirTelefone()}"
style="height: 24px;font-size: 11px"
update="dadosTelefones,tabelaTelefones,validacao"/>
</div>
</td>
</tr>
<tr>
<td>
<p:dataTable var="telefone"
value="#{alterarGaragem.telefones}"
id="tabelaTelefones"
emptyMessage="Nenhum telefone foi adicionado !"
style="font-size: 11px"
paginator="true"
rows="6"
currentPageReportTemplate="({currentPage} de {totalPages})"
paginatorTemplate="{CurrentPageReport} {FirstPageLink} {PreviousPageLink} {PageLinks} {NextPageLink} {LastPageLink}"
rowsPerPageTemplate="6">
<p:column headerText="Tipo" style="max-width: 10%;width: 10%">
<h:outputText value="#{telefone.tipotelefoneIdtipotelefone.descricao}" />
</p:column>
<p:column headerText="DDD" style="text-align: center;max-width: 10%;width: 10%">
<h:outputText value="#{telefone.ddd}" />
</p:column>
<p:column headerText="Número" style="text-align: center;max-width: 20%;width: 20%">
<h:outputText value="#{telefone.numero}" />
</p:column>
<p:column headerText="Ramal" style="text-align: center;max-width: 10%;width: 10%">
<h:outputText value="#{telefone.ramal}" />
</p:column>
<p:column headerText="Contato" style="max-width: 50%;width: 50%">
<h:outputText value="#{telefone.contato}" />
</p:column>
<p:column headerText="Alterar" style="text-align: center;max-width: 10%;width: 10%">
<p:commandLink title="Alterar"
action="#{alterarGaragem.alterarTelefone(telefone)}">
<p:ajax event="click" update="abaTelefones"/>
<p:graphicImage value="/imagens/18x18/editar.png"/>
</p:commandLink>
</p:column>
<p:column headerText="Remover" style="text-align: center;max-width: 10%;width: 10%">
<p:commandLink title="Remover"
action="#{alterarGaragem.removerTelefone(telefone)}"
update="frmAbaTelefones">
<p:graphicImage value="/imagens/18x18/remover.png"/>
</p:commandLink>
</p:column>
</p:dataTable>
</td>
</tr>
</table>
<br/>
</h:panelGroup>
</p:tab>
</p:tabView>
aqui tem mais um painel que mostra validação dos dados
</h:panelGrid>
</h:form>[/code] no commandlink alterar, eu quero atualizar a aba telefones, coloquei um println pra confirmar se a action estava sendo executada, e ela esta sendo executada, mas a tela nao atualiza com os dados do telefone… alguma idéia ? o botão inserir atualiza normalmente a tabela…
Desde já grato !
puts, cagada minha, nao acredito q perdi um dia com isso, deu até vergonha agora hahaha
o que aconteceu foi q eu fui usar pela primeira vez o <p:tabview> e ficava aparecendo uma mensagem “button/textfield bla bla bla tem q estar dentro de um h:form” ± assim, que eu resolvi colocando o codigo abaixo no meu web.xml, só q nessas minhas tentativas colocando forms dentro das tabs e tirando, eu acabei colocando um prependid=“true” no meu form, e era isso q tava causando a cagada, coloquei false e td funcionou certinho<context-param>
<param-name>javax.faces.PROJECT_STAGE</param-name>
<param-value>Production</param-value>
</context-param>