My main jsf include 2 jsf’s where in each one of them there is a table with filtering option.
this is a short example from the main:
<h:panelGroup id="b1">
<p:commandButton
value="exe"
actionListener="#{bean.handle}"
rendered="#{bean.render}"
update=":mainForm:panel1,:mainForm:panel2">
</p:commandButton>
</h:panelGroup>
</h:panelGrid>
</p:panel>
<ui:include src="table1.xhtml" />
<ui:include src="table2.xhtml" />
The problem is that I need to remove the filters when changing the view between the 2 tables I can’t use the client side via clearFilters since I have 2 tables:
<p:commandButton
oncomplete="table1Widget.clearFilters() ????"
so I was thinking that the best place will on the server side via handle method but the filter list is empty and also the table
DataTable dt1 = (DataTable) FacesContext.getCurrentInstance().getViewRoot().findComponent("mainForm: .... ");
How can i reset the filters ?
Thanks
I have 2 datatables at my session. I didn't understand reason but when i use dt1.reset()
it resets both of them.
I tried
dt1 = new DataTable();
and it solved my problem.
Note: dt1.reset()
works when i tried with 1 datatable.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With