Skip to Content

sap.m.List remove items, after sort

Sep 14, 2017 at 11:09 AM


avatar image


I am experiencing some strange behavior.

I bound a JSONModel to a sap.m.List. The content is loaded from an external system, so unfortunately no oData service is available. I have enabled growing for the list. Everytime the user clicks the "extend" button I am getting the next page of items from the external system and add the new items to the existing JSONModel. This is working.

I also want to sort the list. So I implemented a fragment and setting a sap.ui.model.Sorter to the Binding object. The sorting also works.

But after the list has grown, and I change the sorting all additional items are gone. Only the first set of items is visible. Though, the items are still part of the JSONModel. Interestingly, the shrinking happens between the updateStarted and updateFinished event of the list.

Any idea why this is happening?

10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

1 Answer

Philipp Höfler Sep 18, 2017 at 11:59 AM

I found out, that the growingThreshold is applied during the sorting.

From my point of view this is a bug. I am using a JSONModel, so the items are already loaded. No oData Service available for sorting.
But when I am using the sap.ui.model.Sorter the list shrinks to the size of the growingThreshold. In the background the items still exists, but they have been removed from the list.

Any ideas for a workaround?

10 |10000 characters needed characters left characters exceeded