Hi team,
I am getting the records from API. Once i am getting that record i stored it one local variable type of list. after that in one client action via i am doing the filter for that api again that filtered results also stored it same local variable.
now after the filter process is done i am able to get punch of records in that local variable now i need to do pagination for that. kindly help me to fix this issue.
for your reference i have attached my OML.
thanks
karthick balaji
Hi KarthickEven though this wasn't made by me, it looks exactly like what you are looking for:https://www.outsystems.com/forge/component-overview/7700/list-pagination-reactive
Kindly Take a look it may help you
Regards
Murali
hi
I tried that once as well but my scenario is different
In your list filter of your master list, you could calculate the range of row numbers the list can be
Say if Start Index is 9, Page Length is 5, you can filter between rows 9 and 14
sorry i didn't get that i am new for outsystems
sorry i didn't get that i am new for outsystems can you help me to fix this
this article by @Kilian Hekhuis should help
i seen the post it was good but my scenario is different.
i have an data action in that data action i have one filter that filter is used in hospital dropdown you can see i have attached that OML.
second one whenever user able click on search in search client action i am perform lot of filters in same api also i am store all kind of filter values in only one local variable
now the thing is i need to do pagination for that particular local variable. but in this link i seen that data action pagination i tried that one it is working for api pagination.
can you help me to fix this
thanks and regards
I don't think it is different, you are apparently doing 2 distinct things on this screen with the result of that same api. One is serving the hospital dropdown, the other is serving the table at the bottom showing all hospitals that match your filter.
What Kilian is talking about in that talk, matches your second use of that api to a tee.
So follow that guide to get that right, and i would completely separate the other use of that api (for the dropdown) so don't mix the filtering into the data action, just do it inside your client on a local list.
Easiest from developer standpoint would be to just have a separate second data action to server your dropdown, that one can then keep the filtering on city inside that data action.
If you want to make it more complex to gain on your performance, have some mechanism in an onAfterFetch of the single data action that serves both, copy to the dropdown source list if nothing there yet, and after that, apply client side filtering on that list there and in every onChange of city.
Dorine
Hi,
So for my solution
I was thinking you could filter the resulting list by row numbers based on your new start index, and max recordsListFilter.FilteredList.CurrentRowNumber>NewStartIndex and ListFilter.FilteredList.CurrentRowNumber <(NewStartIndex+MaxRecordsIt looks as though the article is doing the same thing in a different way, but by a for loop. Reading it myself, I personally prefer the way mentioned in the article! It's been proven for a start!
If you put the pagination logic in a client action, you can recall it in your on after fetch as well as your search on Click
No @edTheEngineer
Hi karthick
If I understand correctly you want to show paginated data in the grid after the user clicks on the search button.
I have looked at the OML you shared and will recommend the following changes in order to get the data paginated in the grid.
Firstly change the value of the input parameter for the PaginationOnNavigate action like this in the pagination wiget like this
Next In the PaginationOnNavigate action move the assign node right at the beginning of the action
Also, change the Start Index value of the for each loop to the StartIndex variable
Lastly, I would recommend you use the HospitalPagination list as the source of your table instead of the HospitalDetails list because, in the PaginationOnNavigate action, we are setting the hospital data in the HospitalPagination list as per pagination.
You can call this PaginationOnNavigate action right at the end of the search on click action with the input parameter value as 0.
Thanks,
Anshul