I have a dataTable with filters on columns and option to delete a row. When the table is in intial state, if I delete row, the table is updated. If I apply the filter, and delete one of shown rows, the result of the filtering remains, until I refresh the page or change the filter.
Here is the code:
<h:form id="form">
<p:dataTable id="tdataTable" var="tdata" value="#{oemModel.models}" widgetVar="oemModelsTable" editable="true" editMode="cell"
scrollable="true" scrollHeight="500" paginator="true" rows="15"
emptyMessage="No tdatas found with given criteria" filteredValue="#{oemModel.filteredOemModels}">
</p:dataTable>
<p:dialog id="deleteModelDialog" header="Delete " widgetVar="deleteDialog" appendTo="@(body)" showEffect="fade" hideEffect="fade" height="150" width="350" modal="true" resizable="false" >
<h:panelGroup id="deleteModelPanel">
<div align="center">
<h:outputText value="Are you sure?" />
<p>
<h:panelGrid columns="2">
<p:commandButton value="Yes" icon="ui-icon-check" onclick="PF('waitDialog').show();deleteModel();" />
<p:commandButton value="No" icon="ui-icon-close" onclick="PF('deleteDialog').hide()"/>
</h:panelGrid>
</p>
</div>
</h:panelGroup>
</p:dialog>
<p:remoteCommand name="deleteModel" update="tdataTable" actionListener="#{bBean.deleteModel}" oncomplete="PF('waitDialog').hide();PF('deleteDialog').hide();"/>
</h:form>
And in backingBean, I'm deleting it from database, and loading data again:
public void deleteModel() {
try {
service.deleteOemModel(selectedModel.getId());
models= service.getOemModels();
} ...
}
where the models is the binded list.
Any hints? I have tried to change the update attribute on remotecommand, to update the whole form, but nothing helps.