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.
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
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.
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.
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
Please check my article on this subject here.
@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?
Ok so sorting manually via switch for those int/date fields worked.
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?
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.
Hi @Vishwanath Holge please Check this OML
Regards
Ram Baghel
Hi Ram,
The original post is from 2023. Please check the date before answering, thanks.