Hi! I'm new to OutSystems. I have a REST API for Movie List with MongoDB as its database. I need to display 16 items per page but I am having difficulty paginating my list properly. I have tried the 2 following approaches already:

1. I let the API do the pagination on the server side, with the API requiring a page number so that the results are paginated already.
     - There is no problem with the API itself. The challenge is that I am not able to send a page number from the List Navigation to the API Request. Putting the page number as input parameter/query parameter does the job but it is not appealing in terms of user experience.

2. I retrieved all the results from the API without server-side pagination, set the values for the required parameters on the List Navigation. But every time I press a page number on the list navigation widget, the amount of skip in the items depends only on the value of the page number that was pressed (i.e. if I press page 2, the result would be the list starting from the 2nd value of the original list to the next 15 items).

Can someone please help me with this as I've been stuck with this for a few days already. Thank you!

Solution

Bryan Eduria wrote:

Hi! I'm new to OutSystems. I have a REST API for Movie List with MongoDB as its database. I need to display 16 items per page but I am having difficulty paginating my list properly. I have tried the 2 following approaches already:

1. I let the API do the pagination on the server side, with the API requiring a page number so that the results are paginated already.
     - There is no problem with the API itself. The challenge is that I am not able to send a page number from the List Navigation to the API Request. Putting the page number as input parameter/query parameter does the job but it is not appealing in terms of user experience.

2. I retrieved all the results from the API without server-side pagination, set the values for the required parameters on the List Navigation. But every time I press a page number on the list navigation widget, the amount of skip in the items depends only on the value of the page number that was pressed (i.e. if I press page 2, the result would be the list starting from the 2nd value of the original list to the next 15 items).

Can someone please help me with this as I've been stuck with this for a few days already. Thank you!

My apologies. I have solved the problem already. It turned out that the value set on the Start Index of my List Record should have been 

List_Navigation_GetStartIndex(ListRecord.Id, True) 

and not 

List_Navigation_GetStartIndex(MovieGalleryList.Id) / ListRecord.LineCount



Solution