Relative Content

Tag Archive for listscrollpositionsapui5reload

How to preserve the list scroll position after data reload in UI5?

I have a list control inside a scroll container. The list implements the scroll to load functionality. The business logic requires the data in the model to be changed. The problem is that after the reload the list contains only the first subset of the data and is scrolled to its end. For example: Each subset consists of 20 list items. If I scroll to the bottom 2 times I will have 60 list items loaded into the UI. After the model reload the list shows only the first 20 elements and is scrolled to the bottom of the 20 list items. What is the best way to make it restore its previos scroll position?