892
Views
11
Comments
Pagination of local list
Question

Hello, 


I am having problem while implementing pagination for a local list. for table I am giving local list as the source but on pagination it is asking total count. but for local list count does not exist only the length parameter exists. 

When I give the total count as the length property of that list .then pagination is not working.

Does anybody know about local pagination please suggest me

don't provide link that is already discussed about pagination on forum , I have already gone through that 


let me know if you need more info.

2024-11-07 03-28-42
Stuart Harris
Champion

Hi Vishwanath,

Thank you for the question.

I am assuming your local list is a variable containing the list of items. However if it is local database storage, then you can just using paging with an aggregate the same way as you can with a server side entity.

If you are using a local variable containing the list, the source for your table needs to be another local variable that is populated with a ForEach where StartIndex is set to the StartIndex for pagination and Maximum Iterations is set to MaxRecords.

You need the total number of records and the number of records per page (MaxRecords) for pagination to work. You also need the source list to be only the page of items to be displayed.

I hope this helps.

If you need more help, screenshots of your code might help us help you.

Kind regards,

Stuart

UserImage.jpg
Vishwanath Holge

Hello,

let me give some screenshots

In 1st image, you can see InventryList as a local list and in 2nd image you see pagination flow there I am assinging newIndex to StartIndex clearing the local list > refreshing data action > appending all result of data action to local list. 

2024-11-07 03-28-42
Stuart Harris
Champion

Hello Viswanath,

What I'm not seeing there is where you are retrieving the total count of records.

If you are using StartIndex and MaxRecords in your data action then the Length parameter should be equal to or less than MaxRecords.  So in the data action you need to use "Count" to retrieve the total number of records and also return that.

Kind regards,

Stuart

2023-10-21 19-42-11
Tousif Khan
Champion

Hello

Yesterday only I shared some links with the Post in which it is explained how we can implement 

pagination with local list.

https://www.outsystems.com/forums/discussion/86895/pagination-on-navigation-while-retrieve-data-using-data-action/

Thanks

2020-09-15 13-07-23
Kilian Hekhuis
 
MVP

Hi Vishwanath,

Please check my article on this subject here.


2024-01-16 23-21-55
Chris Palka

@Kilian Hekhuis, this is an awesome article, thank you! I do have one minor issue and I feel like it's something so simple that I may be overlooking. When using the IF() condition within the "By" input of List_Sort, my date attribute (LastModifiedDate) doesn't sort correctly, although when it's by itself and not within the condition, it sorts great. All other attributes sort correctly regardless if they're standalone or part of the condition. Anything happen to stand out to you?



2024-01-16 23-21-55
Chris Palka

Ok so sorting manually via switch for those int/date fields worked.

2020-09-15 13-07-23
Kilian Hekhuis
 
MVP

Hi Chris,

Sorry, I didn't get a notification for your post, so I didn't see it (stumbled on it by accident just now). Do you still have a problem with sorting, or is it solved?

2024-01-16 23-21-55
Chris Palka

Hey no problem. I managed to solve it using a switch, it didn't like DateTime or Integer data types when doing it the more dynamic way you suggested. Text types worked fine though.

2024-03-12 10-44-32
Ram Kumar Baghel

Hi @Vishwanath Holge  please Check this OML 

Regards

Ram Baghel

paginationDataAction.oml
2020-09-15 13-07-23
Kilian Hekhuis
 
MVP

Hi Ram,

The original post is from 2023. Please check the date before answering, thanks.

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