Web service as a datasource using RichWidgets List_Navigation widget and pagination

Web service as a datasource using RichWidgets List_Navigation widget and pagination


I have created a web service in outsystems for my entity layer, and I have written a web service method called GetMyObjects, this method takes various parameters which I use as filters, and a Page Number, and Page Size parameter.
The query behind the method is an advanced sql query which will only return the 'page' of data that you requested.

I have tested the query and it returns the correct 'page' of results as expected.

Now, on my web front end module in outsystems, I have a reference to this web service, and I use the GetMyObjects method to populate a TableRecord.
I added the Rich Widget List Navigation widget to the page, and when i load the page, the widget is there, page 1 of my data is correctly loaded, and it shows the total record count correctly with the correct number of pages. 

Now the problem arises when I try to change pages and navigate to the second or third page...
I have a variable which I pass to my webservice method, called PageNumber however I have no way to get the new page number from the widget.
Can anyone help me with this? Note I am not looking for the current page, I am looking for the new page that the user has just clicked the widget requesting.

I assume that plenty of users require paging through other means apart from just direct sql queries so I hope someone can help me.

Also, I assume that the List_Navigation widget doesn't expect ALL items to be loaded into memory as this would be extremely inefficient, especially as the system ages and aquires more and more data.

Perhaps I am using the wrong widget for the job? Is there another pagination widget that I should be using?

Hi Liam,

The typical use case for the RichWidgets pagination is indeed a database query, but you can use it like you do. RichWidgets has an action called List_Navigation_GetStartIndex, which you can use to query the starting row of the current page. Given your page size, you can then easily calculate what page your on.