Datable liveScroll + lazy loading - filter not working

UI Components for JSF
Post Reply
otinanism
Posts: 22
Joined: 29 Oct 2013, 11:37

03 Jul 2014, 12:49

Using PrimeFaces 5.0.

My datatable uses lazy loading and live scrolling and I try to filter both fields:

Code: Select all

<p:dataTable id="eventsTable" value="#{eventController.eventModel}" var="event" lazy="true"
	scrollRows="100" liveScroll="true" scrollable="true" scrollHeight="500">
	<p:column headerText="EID" filterBy="#{event.eid}">
		<h:outputText value="#{event.eid}" />
	</p:column>
	<p:column headerText="Type" filterBy="#{event.type}">
		<h:outputText value="#{event.type}" />
	</p:column>
</p:dataTable>
The initial load retrieves data correctly, and live scrolling seems to work fine.

But when I try to filter one of the fields the datable is completely emptied (It does not even show the "No records found" message). When I debug I can see that my queries are executed correctly and return data.

Also, If I switch using paging instead of liveScroll, pages are lazy loaded correctly and filters also work.

ANy thought?

Thank you in advance.

Alex

chr.c.wilson
Posts: 2
Joined: 11 Sep 2014, 16:12

11 Sep 2014, 16:19

I have also encountered this bug. I dug through the primefaces source and it looks like the FilterFeature used by datatables doesn't take live scrolling into account. When the FilterFeature loads a lazy data model, it tries to use the "rows" attribute on the datatable element which shouldn't be set when using live scrolling. There needs to be a conditional that checks for liveScrolling and uses getScrollRows() to load the lazy data model.

chr.c.wilson
Posts: 2
Joined: 11 Sep 2014, 16:12

11 Sep 2014, 16:44

The same bug also appears when trying to sort a datatable with live scrolling and a lazy data model. The sort feature depends on the "rows" attribute on the datatable element, which shouldn't be set when live scrolling. The sort feature should check for live scrolling and use the scroll rows value instead of the "rows" attribute. It seems several datatable features aren't supported with live scrolling.

krugerman
Posts: 2
Joined: 18 Nov 2014, 12:17

18 Nov 2014, 12:24

I'm facing the same diffect. Sorting also does not work unless 'rows' element is set. However if it is set then scrolling stops working.

I'm using 5.1 version.

krugerman
Posts: 2
Joined: 18 Nov 2014, 12:17

18 Nov 2014, 12:29

I'm facing the same diffect on 5.1. Sorting does not work either as chr.c.wilson mentioned. DataTable just became empty immediately after sorting or filtering. However the request to load the data was executed and appropriate rows were returned by the application.

Post Reply

Return to “PrimeFaces”

  • Information
  • Who is online

    Users browsing this forum: No registered users and 46 guests