I am using JSF and Primefaces in my web application.
I am using p:datatable id="jobEditTable" component of primefaces.
In this i have option of deleting some rows.
In datatable i have one delete button on clicking of that button i am showing a p:dialog id="deleteJob" Then i fill some resaon for deleting in p:dialog then i am clicking on one command link in p:dialog then it calls one action listener where i am clearing the list of data and creating again.
And onClick of that command link i am updating jobEditTable and hiding that p:dialog.
<p:datatable id="jobEditTable" value="#{mastersBean.dataList}"..../>
. . .. . . . . . .
<p:commandLink actionListener="#{tableBean.deleteRow}" update="jobEditTable" oncomplete="deleteJob.hide()">
<p:graphicImage value="/images/delete_button.png" />
<f:attribute name="model" value="#{tableBean.delCode}"></f:attribute>
</p:commandLink>
All is working fine datatable is also refreshing.
BUT if we search for some jobs before deleting and doing that process than data table is not refreshing. WHY??
Means, data table is refreshing if i am not using any filter means without search if i delete some row then data table is refreshing but after searching and on deleting data table is not refreshing..
Why it is behaving like this ??
My bean in view scope.
This is my ManagedBean named MastersBean
public void deleteDetails(ActionEvent e)
{
String id=(String)e.getComponent().getAttributes().get("param");
........deleting data from database according to id.........
dataList.clear();
..........updating datalist again....................
FacesContext context = FacesContext.getCurrentInstance();
context.addMessage(null, new FacesMessage("Successfully Deleted"));
}