Q:

PrimeFaces PickList : two String fields filter

I was wondering if it's possible to have a two fields filter with a picklist of primefaces.
I tried this but it's not working. I would like to filter on firstname and name but they are in two different fields.
<p:pickList value="#{bean.usersDualModel}" var="user" 
    itemValue="#{user}" itemLabel="#{user.firstname} #{user.name}"  
    converter="user" showSourceFilter="true" showTargetFilter="true" 
    filterMatchMode="contains" >

    <p:column>  
        <h:outputText value="#{user.firstname} #{user.name}" />  
    </p:column>

</p:pickList>

Thanks

A:

This is not possible with the default component. However you can create a custom filter (example taken from Primefaces manual):
<p:pickList value="#{pickListBean.cities}" var="city" itemLabel="#{city}" 
    itemValue="#{city}" showSourceFilter="true" showTargetFilter="true
    filterMatchMode="custom" filterMatchMode="myfilter">
</p:pickList>

function myfilter(itemLabel, filterValue) {
//Filter for firstname or name
//return true or false
}

Of course you can also create a custom component by extending the primefaces picklist or create two seperate inputtext fields and fire any filtering manually with javascript/jquery.

