lundi 15 juin 2015

Data does not update in JSF after changes

I am in a web project in which I have basic CRUD for Models. The data is displayed in h:datatable. Everytime I have an update or a new entity, I use an action in the backing bean and pass the change to the controller and I also manually update/add the data in the list that is populating the h:datatable. So, everything is fine. However, if I use some other functionality of my website and then come back to where I have made changes, it looks like the very first request made for populating the h:datatable, even though the changes are kept correctly in the database. My backing bean is a ManagedBean / ViewScoped. I am using Bootsfaces and I would not like to use Primefaces/Richfaces.

These are the method I use to get a List of objects and the latter is the datamodel getter.

public List getLista() {

    lista = controllerc.selectDia();
    return lista;
}

public DataModel<Agenda> getModel() {
    model = new ListDataModel<Agenda>(lista);
    return model;
}

Why it isn't requesting a new list to the h:datatable? Should I use AJAX for this matter?

Aucun commentaire:

Enregistrer un commentaire