Im trying to add somehow to datable's column filtering an autocomplete feature. I created Set with LastNames of clients, also created String text field with getter+setter in my Bean as required in example, but don't know how to add it the filter. Could you help me with it!?
in Bean
private Set<String> lastNames = new HashSet<String>(); //for autocomplite
private String text; //for autocomplite
dataTable
<p:dataTable id="table" value="#{clientsListBean.clientList}" var="item" style="width:95%" styleClass="dataTable"
sortMode="multiple" paginator="true" rows="20" editable="true" sortOrder="descending"
draggableColumns="true" emptyMessage="No clients found with given search criteria"
paginatorTemplate="{CurrentPageReport} {FirstPageLink} {PreviousPageLink} {PageLinks} {NextPageLink} {LastPageLink} {RowsPerPageDropdown}" >
<p:column headerText="Last Name" filterBy="last_name" sortBy="last_name" style="width:auto; text-align:center" for="autocompl" >
<p:autoComplete id="autocompl" value="#{clientsListBean.text}" completeMethod="#{clientsListBean.lastNames}" />
<p:cellEditor>
<f:facet name="output">
<h:outputText value="#{item.last_name}" />
</f:facet>
<f:facet name="input">
<p:inputText value="#{item.last_name}" style="width:100%" />
</f:facet>
</p:cellEditor>
</p:column>