1 Reply Latest reply on May 16, 2008 9:36 AM by Ilya Shaikovsky

    rich datatable with filtering with combo box ?

    Frank Newbie

      Dear all,
      I'd like to use rich data table with filters. In one column there's a textfield and in another a combo box. Is it possible to use the built-in filtering as in this example but with the combo box ?

      <ui:composition xmlns="http://www.w3.org/1999/xhtml"
       xmlns:ui="http://java.sun.com/jsf/facelets"
       xmlns:h="http://java.sun.com/jsf/html"
       xmlns:f="http://java.sun.com/jsf/core"
       xmlns:a4j="http://richfaces.org/a4j"
       xmlns:rich="http://richfaces.org/rich">
       <h:form>
       <rich:dataTable value="#{capitalsBean.capitals}" var="cap">
       <f:facet name="header">
       <rich:columnGroup>
       <rich:column colspan="2" >
       <h:outputText value="Filtering Example"/>
       </rich:column>
       <rich:column breakBefore="true">
       <h:outputText value="State Name"/>
       </rich:column>
       <rich:column>
       <h:outputText value="State Capital"/>
       </rich:column>
       </rich:columnGroup>
       </f:facet>
       <rich:column filterBy="#{cap.state}" filterEvent="onkeyup">
       <f:facet name="header">
       <h:outputText value=" " title="Hack due to bug. Shuold be remoevd till release"></h:outputText>
       </f:facet>
       <h:outputText value="#{cap.state}"/>
       </rich:column>
       <rich:column filterBy="#{cap.name}" filterEvent="onkeyup">
       <h:outputText value="#{cap.name}"/>
       </rich:column>
       </rich:dataTable>
       </h:form>
      </ui:composition>


      Next I've found a more complex example that uses in fact a Combo Box but it's made to use a Complex filterExpression /Method.

      I just need to set a Combo box as Header for the column.
      How can I do it ?
      Thanks
      Francesco