Hi OutSys Devs out here, I just wanted to know how to paginate your table when your data source is a AdvancedSQL in Reactive Web App.
Hi Roel,
You need to handle the pagination by yourself like this:
You also need to do another query with count to use that count on Navigation widget. and you need to handle the sort a bit differently.
I added an example on attachment for you to check.
Regards,
Marcelo
Hi after I added
ORDER BY @TableSortOFFSET @StartIndex ROWSFETCH NEXT @MaxRecords ROWS ONLY;
I am having the below query
Hi Marcelo Ferreira,
Can you help me with this issue?
Before this, I tried your solution which is working fine but with the latest update, I think this issue is occurring.
i have the same error, did you find the solution?
I am using same solution for rest api. We can send single output parameter as response so not getting how to pass second out put parameter total count.
https://www.outsystems.com/forums/discussion/56822/reactive-web-application-paginate-a-table-with-an-advancedsql-source/#Post214417
Hi Marcelo ,
I modified your resolution with introduction of Structure. This helped me to use in REST API
[Attaching modified OML File. I worked on the oml you shared.]
1 - Introduced structure matching employees named -EmployeeStructure
Another structure Employee Dataset has list of EmployeeStructure and Count variable
2 - In Data action changed the input parameter to EmployeeDataset of type EmployeeDataset
3- Changed the Advanced SQL assignment with EmployeeList and Count with Employee count
Same changed I have implemented in my REST Api action as below. It helped me to implement pagination.
JSON Returned by REST API action is
{ "Count": 0, "RecordList": [ { "Id": 1234567891234567, "EmployeeId": 1234567891234567, "RequestId": 1234567891234567, "CreatedDate": "2014-12-31", "CompletedDate": "2014-12-31", "StatusId": 0, "BonusAmount": 0.1, "BonusThreshold": 0, "HalfBonusThreshold": 0, "ThresholdUnitPrice": 0.1, "HalfThresholUnitprice": "string", "RequestName": "string", "EmployeeFirstName": "string", "EmployeeLastName": "string", "StatusLabel": "string" } ] }