PF 5.0.2, Mojara 2.1.21
I have DataTable with filters and my own autocomplete box for DataTable filtering. If I want to update a DataTable I use "PF('table').filter()", because "normal" update doesn't function. The problem is that "PF('table').filter()" reinitialized "filteredValue"-Backing Bean property list with filterd values from client and ignores the value in my own autocomplete textbox
<p:dataTable filteredValue="#{bean.filtered}"
value="#{bean.values}"
widgetVar="table" >
<p:column filterBy="#{bean.number}">
#{bean.number}
</p:column>
...
</p:dataTable>
<p:autoComplete value="#{bean.textFilter}" />
<p:commandButton value="OK" oncomplete="PF('table').filter();" update="" />
<!-- no update :) -->
So for example before OK was clicked
Before:
bean.filtered= { 1}
bean.values = { 1, 2, 3}
and after OK was clicked it will be changed to
After:
bean.filtered= { 1, 2, 3 }
bean.values = { 1, 2, 3 }
And I want that it remains as before.
EDIT: I've accepted the answer but there are concerns. It does make the job. But primefaces behaves crazy, because set-method doesn't do what PrimeFaces think it should do. So I used filterEvent on DataTable to achieve what I want.