Em uma mesma janela eu tenho um cadastro, e baixo do cadastro eu tenho um dataTable..
resumindo, quando for cadastrado é atualizado o dataTable embaixo
<%@tagliburi="http://java.sun.com/jsf/html"prefix="h"%><%@tagliburi="http://java.sun.com/jsf/core"prefix="f"%><%@tagliburi="http://richfaces.org/a4j"prefix="a4j"%><%@tagliburi="http://java.sun.com/jstl/core_rt"prefix="c"%><%@tagliburi="http://richfaces.org/rich"prefix="rich"%><%@pagelanguage="java"contentType="text/html; charset=ISO-8859-1"pageEncoding="ISO-8859-1"%><!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"><html><head><metahttp-equiv="Content-Type"content="text/html; charset=ISO-8859-1"><title>Insert title here</title></head><body><f:view><a4j:regionid="reg"><a4j:outputPanelid="msg"><h:messagesstyle="color: red"/></a4j:outputPanel><a4j:outputPanelid="saida"><a4j:formid="cadastro"><h:panelGridcolumns="2"><f:facetname="header"><h:outputTextvalue="Pagamentos"/></f:facet><h:outputTextvalue="Nome:"/><h:inputTextsize="25"value="#{pagamentoBean.pagamento.nomeResponsavel}"/></h:panelGrid><a4j:commandButtonvalue="Salvar"action="#{pagamentoBean.createOrUpdatePagamento}"reRender="saida,msg,reg"/><h:dataTablevalue="#{pagamentoBean.allPagamento}"var="item"><f:facetname="header"><h:outputTextvalue="PAGAMENTOS"/></f:facet><h:column><f:facetname="header"><h:outputTextvalue="Nome"/></f:facet><h:outputTextvalue="#{item.nomeResponsavel}"/></h:column></h:dataTable></a4j:form></a4j:outputPanel></a4j:region></f:view></body></html>
ja coloquei ID no dataTable e no region, mas quando cliko em Salvar, ele cadastra novamente mas minha dataTable nao atualiza
=(
ftabah
Deluxe:
nao existe ajaxSingle no a4j:region
fiz um novo exemplo
<%@tagliburi="http://java.sun.com/jsf/html"prefix="h"%><%@tagliburi="http://java.sun.com/jsf/core"prefix="f"%><%@tagliburi="http://richfaces.org/a4j"prefix="a4j"%><%@tagliburi="http://java.sun.com/jstl/core_rt"prefix="c"%><%@tagliburi="http://richfaces.org/rich"prefix="rich"%><%@pagelanguage="java"contentType="text/html; charset=ISO-8859-1"pageEncoding="ISO-8859-1"%><!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"><html><head><metahttp-equiv="Content-Type"content="text/html; charset=ISO-8859-1"><title>Insert title here</title></head><body><f:view><a4j:regionid="reg"><a4j:outputPanelid="msg"><h:messagesstyle="color: red"/></a4j:outputPanel><a4j:outputPanelid="saida"><a4j:formid="cadastro"><h:panelGridcolumns="2"><f:facetname="header"><h:outputTextvalue="Pagamentos"/></f:facet><h:outputTextvalue="Nome:"/><h:inputTextsize="25"value="#{pagamentoBean.pagamento.nomeResponsavel}"/></h:panelGrid><a4j:commandButtonvalue="Salvar"action="#{pagamentoBean.createOrUpdatePagamento}"reRender="saida,msg,reg"/><h:dataTablevalue="#{pagamentoBean.allPagamento}"var="item"><f:facetname="header"><h:outputTextvalue="PAGAMENTOS"/></f:facet><h:column><f:facetname="header"><h:outputTextvalue="Nome"/></f:facet><h:outputTextvalue="#{item.nomeResponsavel}"/></h:column></h:dataTable></a4j:form></a4j:outputPanel></a4j:region></f:view></body></html>
ja coloquei ID no dataTable e no region, mas quando cliko em Salvar, ele cadastra novamente mas minha dataTable nao atualiza
=(
Olá amigo, #{pagamentoBean.allPagamento} é um método que retorna uma lista, certo? Você está executando-o novamente antes de dar um reRender?
Porque mesmo após o cadastro, pode ser que o bean não esteja atualizando a lista, certo?
Abraço!
Deluxe
ai cara
tava renderizando…
o problema é pq a lista nao vinha atualizada…
que newbie
hehe
vivendo e aprendendo…
vlw
=)
ftabah
Deluxe:
ai cara
tava renderizando…
o problema é pq a lista nao vinha atualizada…
que newbie
hehe
vivendo e aprendendo…
vlw
=)
imagina, a gente aprende ‘errnado’ mesmo.
comigo isso já aconteceu também e pra descobrir foi um saco, hahaha!
abs! :thumbup:
C
claudia.asm
Olá, acho que estou com o mesmo problema…como vc. conseguiu atualizar a lista na renderização?