cancel
Showing results for 
Search instead for 
Did you mean: 

How Pagination Functionality works in SAPUI5?

Jayakrishnan
Active Participant
0 Kudos

Hi Everyone,

We are working on custom SAPUI5 application development. as part of the app , we have to showcase the data into table. I am having some doubts regarding pagination.

1. For Example if i have 1000 records, i set the growing = true and threshold value as 25. By default it will show first 25 records. after clicking the next 25, will it call OData again? or can we handle it on Front end model(OData v2 Model)?

2.By default the size limit is 100 for OData, if i explicitly mention as 1000, will it create any impact ? performance?

3.Without calling the service again and again , can i get the entire data into OData model then go for pagination?

Thank you,

Regards,

JK.

Accepted Solutions (0)

Answers (1)

Answers (1)

brian_keenan
Contributor

In the manifest.json file where you add the odata model there is a parameter call "defaultOperationMode" this determines the use,

If set to server it trigger a new request with every odata update.

If set to client it will load the full model.(If the model is big, this can cause performance issues and ever crash the client)


"models": {
   "i18n": {
     "type": "sap.ui.model.resource.ResourceModel",
     "settings": {
       "bundleName": "sap.i18n.i18n"
    }
}
"": {
    "type": "sap.ui.model.odata.v2.ODataModel",
    "settings": {
       "metadataUrlParams": {
           "sap-documentation": "heading"
        },
        "defaultOperationMode": "Server",
        "defaultBindingMode": "OneWay",
        "disableHeadRequestForToken": true,
        "defaultCountMode": "Request"
     },
     "dataSource": "service.xsodata"
},
Jayakrishnan
Active Participant
0 Kudos

Thanks Brian,

So if i set "defaultOperationMode": "Server", then it will call my OData service whenever i click the next button in the pagination. am i correct?

so what happen if am having more than 100 records in the OData. Will it return all the data without set the limit explicitly?

Thank you.


brian_keenan
Contributor
0 Kudos

if set to client it will return all and then the filtering etc will be done on the client.

With server it will make a call each time no matter what. With large amount of data its best to use server.

but to experiment a little have a look at the calls in the network/console tab of F12 and you will see.