Page 1 of 1

Is it possible to have a selectOneMenu filter with multiple words?

Posted: 18 Sep 2017, 20:19
by leacardenas
I want to know, if it is possible to have the component p:selectOneMenu of primefaces with a filter that works by filtering several words.

Similar to how p:chips works.

So I add several words and the filter will go filtering by the data that contains all of the words that I add to the list.

Re: Is it possible to have a selectOneMenu filter with multiple words?

Posted: 18 Sep 2017, 20:24
by Melloware
I don't think so out of the box but what you could do is use a custom filterFunction like...

filterFunction="#{mycontroller.filterFunction}"

Where you took all the strings from the filter and did your own custom search. So you could do something like "dog cat" and in your custom filter function split on space and search for dog and cat keywords etc.

Re: Is it possible to have a selectOneMenu filter with multiple words?

Posted: 23 Sep 2017, 02:46
by leacardenas
Perfect, thank you. I will try it.