4 Replies Latest reply on Sep 21, 2009 9:36 AM by Chandra Sreeraman

    Filter Expression for DataTable(s)

    Chandra Sreeraman Newbie

      Hello

      I am trying to use filterexpression in a rich:datatable. The RichFaces documentation gives a sample using a JSTL function ( <rich:column filterExpression="#{fn:containsIgnoreCase(cap.timeZone,
      filteringBean.filterZone)}">). This requires another field to be defined that contains the filter expression.

      What I want is to use the default filter mechanism given by RichFaces, but have a custom filter ; e.g:

      
       <rich:extendedDataTable value="#{qaInputBean.verifyScriptList}"
       var="verifyScript" id="t1" width="99%">
      
       <rich:column id="tcName" label="TestCase Name" width="15%"
       sortable="true" sortBy="#{verifyScript.testCase.name}"
       filterBy="#{verifyScript.testCase.name}" filterEvent="onblur" filterExpression="...">
      
       .... more column definitions
      
      <rich:extendedDataTable value="#{qaInputBean.verifyScriptList}" var="verifyScript" id="t1" width="99%"> <rich:column id="tcName" label="TestCase Name" width="15%" sortable="true" sortBy="#{verifyScript.testCase.name}" filterBy="#{verifyScript.testCase.name}" filterEvent="onblur" filterExpression="..."> .... more column definitions
      
      


      Without the fitler expression, the above code produces a table with the field and a box below it to enter the filter value and the default retuns 'startBy'.
      I'd like to add a filter expression that gives me a 'Contains Ignorecase' filter as mentioned previously - i.e., get me all records that have the particular column with matching values.

      Has anyone done something similar?

      Thanks in advance

      Chandra