I am trying to implement a comma separated keyword search using global filter in PrimeFaces.
If user types in word1,word2
in the global search, all the rows which have word1
and word2
should be returned. As of now, I was not able to find a predefined multi word search functionality for global search in PrimeFaces. Global search only works with a single keyword. Eg: Search returns results only if user types either word1
or word2
.
Seems like PrimeFaces uses client API filter() for global search. Is there a way to implement a search using multiple keywords?
<p:dataTable id="dwg" widgetVar="tblDwgDtl" var="dwgDtl"
value="#{dwgCtrlr.dwgs} sortMode="multiple" scrollable="true"
styleClass="bsa-drawing" rows="25" resizableColumns="true">
<f:facet name="header">
<p:panelGrid styleClass="ui-panelgrid-blank">
<p:row>
<p:column colspan="6">
<p:inputText id="globalFilter"
onkeyup="PF('tblDwgDtl').filter()"
placeholder="#{msg['searchAllFields.text']}" />
</p:column>
</p:row>
</p:panelGrid>
</f:facet>