3 Replies Latest reply on May 6, 2016 5:15 AM by Michal Petrov

    Richfaces 3.3.4 in richdatatable column combination of filter and sort not working properly

    Nitin Parihar Newbie

      Hi,

      Currently i am working on richfaces 3.3.4, i have the requirement of getting data based on filter value. the column should have both filter and sorting functionality.

      if i am using the default then it is working fine but does not fill my requirement of filtering anywhere in the text not only with starting of text.

      Here is the default code :

      <r:column sortBy="#{groupData.groupName}"

                                  filterBy="#{groupData.groupName}"

                                  filterValue="#{ListGroupsManagedBeans.filterValueGroupName}"

                                  filterEvent="onkeyup" id="groupFilter"

                                  sortOrder="ASCENDING">

                                  <h:outputText value="#{groupData.groupName}"

                                      action="#{CreateGroupManagedBean.selectedGroup}" />

       

       

                                  <input type="hidden"

                                      name="modifyGroup#{index}"

                                      value="#{groupData.groupName}" />

                              </r:column>

       

      This does search from starting of text. To furnish my requirement, i have to make my own custom filter using this code

       

      <r:column sortBy="#{groupData.groupName}"

                                  filterBy="#{groupData.groupName}"

                                  filterValue="#{ListGroupsManagedBeans.filterValueGroupName}"

        filterExpression="#{fn:containsIgnoreCase(groupData.groupName,ListGroupsManagedBeans.filterValueGroupName)}">

        <f:facet name="header">

        <h:inputText value="#{ListGroupsManagedBeans.filterValueGroupName}">

        <a4j:support event="onkeyup" reRender="dataTable" execute="@this" onComplete="setCaretToEnd(event);" />

        </h:inputText>

        </f:facet>

                                  <h:outputText

                                      value="#{groupData.groupName}" />

                              </r:column>

       

      If i use this, then filter & sort both combined does not work properly, instead filter box also works as sort.

       

      Please look into this and give some solution asap, also the sort button should be present above filter box in the same column.