DataTable does not update immediately after the "action"

1

I have a DataTable with some data when I select a row of the table and click on the end of process this line is saved in my bank with the status Finalizado and Cargo of the logged in user, however that line only add from my table after several F5 or else I go out and enter the table again. I'm loading the data into the table through this method:

@ManagedBean(name = "controleAuditoriaBean")
@ViewScoped
public class ControleAuditoriaAuditorBean {
private List<SolicitacoesBD> list;
private List<SolicitacoesBD> listEnviados;
@PostConstruct
    public void carregarPesquisa() {

        try {
            SolicitacoesDAO solicitacaoDAO = new SolicitacoesDAO();
            //Se o cargo for "Liberacao" e o Status for "finalizado" faz a pesquisa.
            list = solicitacaoDAO.listarPorUsuario("Liberacao", "Finalizado");


            System.out.println("Caminho: "+solicitacoesBD.getCaminhoArquivo());
        } catch (RuntimeException ex) {

        }
    }
}

I'm using ViewScoped in this Bean.

And this is how my dataTable starts:

<p:dataTable id="tblAudAud" emptyMessage="Nenhum registro encontrado"
                var="controleAuditoria" value="#{controleAuditoriaBean.list}"
                filteredValue="#{controleAuditoriaBean.listFiltrada}" rows="10"
                paginator="true" style="margin-top: 5px;"
                rowKey="#{controleAuditoria.codigoBeneficiario}">

Can it be the system that is heavy? Why not update?

    
asked by anonymous 15.06.2015 / 22:26

1 answer

3

You have to clean your list because with @ViewScoped the bean is held until the application navigates to another page, and depending on how you navigate it does not clean the data.

    
15.06.2015 / 23:29