I - unfortunately - work with jsf and I have a problem. I have a jsf page that displays a table with some data using a component <h:dataTable>. Each row of this table has <h:commandLink>a "Delete" action to remove an item in this row. When I perform this action, the method in the reverse bean is correctly called, the ArrayList that contains the elements of the table is displayed correctly, and the navigation method returns to the same page where the table is located, it is executed correctly.
But , when the page reloads, the table does not refresh . I see the same elements that were in the table before the delete action.
If I reload the page, now the table is updated.
It seems that the view is being visualized before the bean support has completed its updates.
How to make visualization of a view only when the bean backup has completed the update?
Here is the code:
Command line on jsf page, inside dataTable:
<h:column>
<f:facet name="header">
<h:outputText value="Rimuovi" />
</f:facet>
<h:commandLink action="#{servicesListBean.removeServizio}" title="Rimuovi questo servizio" onclick="if(!confirm('Vuoi davvero rimuovere questo servizio?')) return false">
<h:outputText value="Rimuovi" />
</h:commandLink>
</h:column>
And here is the method in the bean base:
public String removeServizio() {
this.servizioToRemove = (Servizio) getDataTable().getRowData();
try {
ServiziDAO.removeServizio(this.servizioToRemove.getId());
} catch (Exception e) {
}
return userSessionBean.goToElencoServizi();
}
In this case, I have provided a request scope for bean support. I already tried to provide its session scope and call the method to update the list, but the result is the same.
I hope I was clear enough. Thanks to everyone in advance.
UPDATE THIS QUESTION WHAT CHANGES EVERYTHING
Thanks to everyone. As McDowell said, the problem was not at the time the visualization was rendered, and the problem was not at all in the JSF.
, , , . , , , , System.currentTimiMillis(), , , sysdate Oracle.
, , : !
, - .