I built a tree using Primefaces JSF and I need to add a filter, where it update the data of the tree according to what the user typed. Does anyone know if this is possible ? I still can not find a solution.
Tree: http://www.primefaces.org/showcase/ui/data/tree/basic.xhtml
Primefaces Tree support filters since Primefaces 6.1
<p:tree value="#{treeBasicView.root}" filterBy="#{node}" var="node">
<p:treeNode>
<h:outputText value="#{node}" />
</p:treeNode>
</p:tree>
https://www.primefaces.org/primefaces-6-1-final-released/
For older versions, see the other answer.
Before PrimeFaces 6.1 this was not possible IN the tree. On older versions just create an input field outside the tree and update the tree after calling a bean that server side updates the data for the tree based on the value of the input field.
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