When i selected a row on the First page and moving to next page and again if i am coming back to first page the selected row gone.I am not able to keep selected row while doing pagination.The data which i am showing is coming from Stored Procedure.
Hi Sarthak,
I have built a simple demo for your use case and attaching an oml for the same.
You can access it on the below url -
https://personal-cscpmcir.outsystemscloud.com/TestFeature/PaginationDemo
I have assumed that the stored procedure getting used would have a field for selection. If there is any deviation do let me know I can work out that change.
Thanks
Rahul Yadav
Hello @Rahul Yadav ,
It is failing while deselecting the row.
Step to reproduce:-
1) select three rows on the first page then go to the second page and select three again.
2) come to the first page and deselect anyone and go to the next page and come again on the first page.
It shows selected
Regards Gourav Shrivastava
Thanks Gourav for pointing out. I have fixed it now.
Hi sarthak singh,
Using Client/Local variable you can preserved the selected row Id into a client/local variable and on after fetch of aggregate or dataaction again check then selected row id and make that row selected again.
Attaching OML file for your refrence.
I don't know how you are exactly calling your procedure (by dataaction or onclick of button getting output from a server action) to get data on screen
if you are using Stored procedure then probably using Dataaction to run SQL you need to check preserved the selected row Id on afterfetch of the dataAction.
Thanks,
Sanjay Kushwah
Hi sarthak,
You need a bulk selection and it should retain while doing pagination right?
Solution: In the below link, it is explained clearly. Check it.
https://medium.com/disrupting-outsystems/bulk-select-the-right-way-in-outsystems-cc7933f6be07
Hope it helps.
Regards
Mohan
Hello;
I would create an id list that stores the id of all selected items.
Hello @Sarthak Singh ,
In OutSystems Reactive applications, to maintain state such as selected rows across paginations, you can use client variables or local storage to store the state of the selected items. When the data is fetched from a Stored Procedure (SP), it's especially important to handle the state on the client side because the SP will not maintain the state for you.
Here's a general approach to keep track of selected rows across pagination:
This approach should fix your problem if I understood your problem correctly.