dataTable bug when using sortBy and filterBy?

UI Components for JSF
Post Reply
Lopura
Posts: 2
Joined: 19 Nov 2010, 11:55

25 Nov 2010, 09:45

Hi,

I'm using a dataTable where one column has the sortBy and the filterBy attributes set and some other columns only use sortBy. The filter also uses the filterOptions, so a drop-down of all possible filters is displayed.
The sorting itself works. The filtering itself also works. However, whenever I used the filter, the sorting does not work any more. Clicking on sorting results in a data table with no data left. The number of rows is still correct, but all String entries are empty and all integer entries are 0. Using the filter once again, the data re-occurs, but disappears as soon as any column is sorted.
Here's my code for the column using sortBy and filterBy:

Code: Select all

<p:column sortBy="#{myBean.city}" filterBy="#{myBean.city}"
                  filterOptions="#{backingBean.cityOptions}"
                  filterMatchMode="exact">
          <f:facet name="header">
            Cities
          </f:facet>
          <h:outputText value="#{myBean.city}"/>
</p:column>
In the show case there's no combination of filtering and sorting, but I also didn't see a comment that both of these should be used in the same dataTable. Could this be a bug in the dataTable?
I'm using PrimeFaces 2.2RC2.
Thanks in advance.

vaf
Posts: 1
Joined: 25 Nov 2010, 11:54

25 Nov 2010, 12:20

Hello,
I have similar problem and can be exactly applied on Lopura's code (if #{backingBean.cityOptions} is e.g.List<City>).
- filterBy works fine defined alone as well as defined with sortBy
- separate sortBy is defined (without filterBy), sorting doesn't work
- sortBy defined also with filterBy works fine if only filtering is used before (both user entered string or select items works fine)
This datatable is placed in facelets composition page. Used configuration: PrimeFaces 2.2RC2, Mojarra-2.0.2 (also previous PrimeFaces RC versions had same behavior, on milestone filtering didn't work for me).
Any advice what should be wrong is welcome. Thank you for your good work on library.

Post Reply

Return to “PrimeFaces”

  • Information
  • Who is online

    Users browsing this forum: No registered users and 40 guests