How is your experience with the OutSystems Community?
25
Views
4
Comments
List widget with OnScrollEnding
Question

In a reactive app i'm using a list widget with OnScrollEnding. Every time this events is triggered, i fetch more data from the database with an advanced sql. This works fine.

But after each refresh of the data action, the list goes back to the first records of the list instead of scrolling further.

Does someone have a solution for this problem, because according the documentation the list must scroll further instead of going back to the first records.

2026-06-20 17-43-43
Sherif El-Habibi
Champion

Hello @Jan Hidding,

First, there's a condition that checks whether the length of the list you're viewing is greater than or equal to the current maximum number of records minus the current increment. If that condition is true, it means you want to load the next batch of records.

In that case, you simply update the maximum records value. For example, if you're currently viewing records 0–20, the next range becomes 20–40. That's the logic as I understand it.

If possible, you could share the OML if any details is needed.


UserImage.jpg
Jan Hidding

That is correct, except it fetches not the range 20-40 records, but 0-40 records. The startindex is not used here, only the maxrecords.

The demo template List with Chart, when you create a new screen, has the same problem. 

2026-06-20 17-43-43
Sherif El-Habibi
Champion

I think there is a misunderstanding.

Here's what happens in this scenario: assume there are 100 records in total, and the maximum number of records displayed at a time is 20. Initially, the first 20 records are visible on the screen.

When you scroll to the end of those 20 records (reaching record 21), the list is refreshed. However, it does not clear the entire list first. Instead, it fetches both the existing records and the new ones together, so the total number of displayed records becomes 40.

The reason it appears as though the list is not refreshing is because the loading spinner is triggered. When the spinner appears, it causes the list to jump back to the top, creating the impression that nothing has changed or that the refresh did not happen.

If you remove the spinner (or the condition that triggers it), you'll see the expected behavior. This applies specifically to the List with Chart screen you mentioned.

UserImage.jpg
Francisco Franco

Keep the List permanently visible and show the spinner below the List, only while fetching. Then increase MaxRecords and refresh the Data Action.

Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.