89
Views
7
Comments
Solved
Navigation/Pagination MaxRecords shows all records
Question
Application Type
Reactive

Dear OutSystems community,

I have a problem with pagination/navigation.  I am fetching a data using REST and get a list of records, which is correct. I set a default value of MaxRecords to 5, but my list would show all records.

What could be the problem? 

 Thanks and kind regards,

Elena


Screenshot 2023-04-27 142747.png
2021-09-06 15-09-53
Dorine Boudry
 
MVP
Solution

Hi @Elena Mulgacheva ,

Just having a maxrecords variable in your screen, and having a pagination widget on it, will not magically reduce the list to the ones you want to show, you still need logic to do that for you.

See this article by @Kilian Hekhuis ,

Dorine

2021-05-18 15-50-52
Elena Mulgacheva

Thanks Dorine, it helped! It works now.

Kind regards,

Elena

2023-04-06 11-24-23
Paulo Zacarias

Hi Elena, 

Can you show us what you have set for the list source and its details, as well as what you have set on the Navigation/Pagination widget?

Regards, 

PZ

2021-05-18 15-50-52
Elena Mulgacheva

Hello Paulo,

yes, please find screenshots attached.

Thanks.

Regards,

Elena

Navigation_Pagination_Details.png
List_Source.png
2021-05-18 15-50-52
Elena Mulgacheva

I am not sure if the Total Count Value is right..

2023-04-06 11-24-23
Paulo Zacarias

It can be the MaxRecords on the source.

The GetInvestorsRest needs to have a MaxRecords set to 5 in your case.

For the count, you can have a separate output, taking into consideration all the data that comes from your source. 

So you will have you list attribute, with the records (in your case, 5) and then another attribute for the count.

Please check if that's the issue, otherwise we can try to check it again.

Regards, 

PZ

2021-09-06 15-09-53
Dorine Boudry
 
MVP
Solution

Hi @Elena Mulgacheva ,

Just having a maxrecords variable in your screen, and having a pagination widget on it, will not magically reduce the list to the ones you want to show, you still need logic to do that for you.

See this article by @Kilian Hekhuis ,

Dorine

2021-05-18 15-50-52
Elena Mulgacheva

Thanks Dorine, it helped! It works now.

Kind regards,

Elena

2023-04-06 11-24-23
Paulo Zacarias

Hi Elena, 

Dorine is totally right, that article is really great for understanding how these properties related to navigation/pagination work. 

I created a sample oml for you, trying to simulate your scenario. 

I hope this helps.

Regards, 

PZ

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