I have a datatable with item list. For some items, I will have a jquery dialog prompt with buttons. Selecting a button say 'yes' will do AJAX call and should delete the item from list in bean (which is working fine) and reload datatable list (this update is not happening). below is my code snippets .. I am using JSF 2.0
<h:dataTable binding="#{itemBean.dataTable}" value="#{itemBean.items}"
var="item" columnClasses="left,right" rowClasses="row1,row2" rows="4" >
<h:column>
<h:outputText styleClass="label" value="#{item.product.itemNo}"/>
</h:column>
</h:dataTable>
// ItemBean class - @Session scoped
private HtmlDataTable dataTable;
private LinkedList<Item> items;
deleteRow(){ } method in bean is deleting item from the items list.
on button click in dialog prompt, .post ajax call is made as below.
$.post('/WebApp/PromptAjaxServlet', {data:requestData}, function(response) {
if(validateResponse(response)){
$('#dialog-form').dialog('destroy');
$modalMessage.dialog('destroy');
} else {
// do
}
});
can someone please help with an idea on how to update datatable list after ajax call ..