2 Replies Latest reply on Nov 11, 2008 12:12 PM by x490812

    How to implement advanced filtering

      I have an extendeddatatable and each of the 11 columns has a sortBy on the column and a filterBy on the column. This works well, EXCEPT, that I want to be able toa add external filtering logic to SOME of the columns and leave built-in filtering for the others. Is this possible, Or do I have to scrap the extended datatable and use a datatable and do everything manually?
      The filtering example shows a column Group in the header facet of the table for external filtering, and inputTexts in the header facets of the columns. With Built-In filtering, it shows header facets in the columns holding the column name - not the input text box. How do you reconcile these 2 different models so that you can have built-in for some columns and external for other columns?

      Here is some of my code - the processMonth column (2nd) is the one on which I would like to use external filtering logic.

      <rich:extendedDataTable value="#{taxSummaryList.resultList}"
       var="tax" id="taxSumTbl" width="100%" height="400px"
       sortMode="single" columnsWidth="0*">
       <rich:column width="25" sortBy="#{tax.id}"
       filterBy="#{tax.id}" filterEvent="onkeyup">
       <f:facet name="header">
       <h:outputText value="Id" style="font-size:xx-small;"/>
       </f:facet>
       <s:link view="/tax_summary_item.xhtml" value="#{tax.id}">
       <f:param name="tsID" value="#{tax.id}" />
       </s:link>
       </rich:column>
       <rich:column width="85"
       sortBy="#{tax.processMonth}" filterBy="#{tax.processMonth}"
       filterEvent="onkeyup" >
       <f:facet name="header">
       <h:outputText value="Process Month" style="font-size:xx-small;" />
       </f:facet>
       <h:outputText value="#{tax.processMonth}" style="font-size:xx-small;">
       <f:convertDateTime type="date" dateStyle="short"/>
       </h:outputText>
       </rich:column>
       <rich:column width="85"
       sortBy="#{tax.percentOfUpb}" filterBy="#{tax.percentOfUpb}"
       filterEvent="onkeyup">
       <f:facet name="header">
       <h:outputText value="Percent of UPB" style="font-size:xx-small;" />
       </f:facet>
       <h:outputText value="#{tax.percentOfUpb}" style="font-size:xx-small;" >
       <f:convertNumber type="percent" maxFractionDigits="4" />
       </h:outputText>
      
       </rich:column>
      
      .
      .
      .


        • 1. Re: How to implement advanced filtering
          ilya_shaikovsky

          just not use filterBy to turn built-in filtering off. Use filterMethod or filterExpression. Should be used the same as for dataTable.

          • 2. Re: How to implement advanced filtering

            There is a misunderstanding - The problem I am having is that I cannot get the inputText to display underneath the header. In your example for external filtering, you have a columnGroup. In the example for builtin filtering, you put the column headers in the column. How do I reconcile these 2 models so that I can get both in 1 datatable - how do I get an inputTextBox for the filter if I have a header already holding the column name?