Pagination not working
Question
Application Type
Reactive

Hi,


I'm having an issue with pagination. I only get displayed the same first records of the aggregate for each new page. Unfortunately I can only attach one image so I can't show. However, I have StartIndex and MaxRecords both in aggregate and pagination, and in the pagination function I have StartIndex = NewStartIndex and then I refresh the aggregate.


Thanks and best regards,

Fran

Solution

Hi Márcio,

I managed to find the solution. I added sorting by id and now it works.

Thanks,

Fran

Hello Fran, when you try some test values on the aggregate, does it show duplicated values? If you go to page 10 displaying 50 records per page for example, how does it appear?

Hi Anderson,

No, the aggregate doesn’t show duplicated values. My list displays ‘title’. I changed my records titles to 1,2,3,....,17 or so. On page 1 (the first records) shows 1 and 2 and every other page shows 2 3 4 5 6.


Best regards,

Fran

Are you using data action, or simply an aggregate at the screen level?

For data action, you can have a look at this that explains how to do it. You have also an app on the forge that explains how to do it.

https://itnext.io/paginating-sorting-and-filtering-data-from-a-data-action-f5cb997fdc60

If you are just using an aggregate, please share an OML or have a look at the courses you will see for sure what you are doing wrong.

https://www.outsystems.com/training/courses/143/pagination-and-sorting/

PS: I think you are not setting the new start index.

Kind Regards,

Márcio

Solution

Hi Márcio,

I managed to find the solution. I added sorting by id and now it works.

Thanks,

Fran

I will assume the same as what @Márcio Carvalho said. If the aggregate doesn't show duplicate values (so it's not a join/filter issue) and your pagination is changing on click, then most likely the new starting index might not be set as it should. If you could at least share an image (in case you can't share the OML) of the screen, then we could check the situation.

Hi Anderson,

I added sorting by id and now it works.

Thank you,

Fran

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