Complex Data Table (Sort & Filter) not working together.

UI Components for JSF
Post Reply
JMilnes
Posts: 110
Joined: 12 Feb 2010, 20:03

07 Oct 2010, 16:04

I have a complex data table.

Filtering & Sorting

Code: Select all

<p:dataTable var="ds" value="#{transferController.datasetDetail}">
<p:column sortBy="#{ds.sequence}">
  <f:facet name="header">
     <h:outputText value="Sequence"/>
  <f:facet>
    <h:outputText value="#{ds.sequence}" />
</p:column>
<p:column sortBy="#{ds.command}" filterBy="#{ds.command}">
  <f:facet name="header">
    <h:outputText value="Command"/>
  </f:facet>
<h:outputText value="#{ds.command}"/>
</p:column>
</p:dataTable>
If I filter by command then hit sort on the sequence number the data table shows that there is still 2 records (from the filter) but the values are 0.

In DataHelper class decodeSortRequest method

Collections.sort(list, new BeanPropertyComparator(sortColumn, table.getVar(), asc));

The list still has the 2 objects (beans) but the value of the bean's objects are blank.
Which is why the datatable is blank...

(This is using the session scope)
JSF 2.3.0-FCS Mojarra
Prime faces 3.0.M4
Tomcat 7.0.20
IE 8

JMilnes
Posts: 110
Joined: 12 Feb 2010, 20:03

25 Oct 2010, 17:40

Needed to implement Serializable
JSF 2.3.0-FCS Mojarra
Prime faces 3.0.M4
Tomcat 7.0.20
IE 8

Dsleeper
Posts: 119
Joined: 29 Jul 2010, 13:33
Location: Bergen, Norway
Contact:

10 Nov 2010, 16:21

I had the same problem for a long time and it was not until I read your post I knew how to fix it. Thx!
Primefaces, Mojarra, Tomcat

http://www.dsleeper.net
https://www.mylog.no

JMilnes
Posts: 110
Joined: 12 Feb 2010, 20:03

10 Nov 2010, 19:17

Your welcome. That is why I updated my post when I figured it out. I figured I couldn't be the only one :D
JSF 2.3.0-FCS Mojarra
Prime faces 3.0.M4
Tomcat 7.0.20
IE 8

Post Reply

Return to “PrimeFaces”

  • Information
  • Who is online

    Users browsing this forum: No registered users and 50 guests