Quantcast
Channel: SAPUI5 Developer Center
Viewing all articles
Browse latest Browse all 789

How to Define OData $top-Parameter for an aggregation binding

$
0
0

Setup: A UI5 Application using a OData Model

Target: Limit the data that is fetched for an aggregation binding by specifing the $top parameter

Why?: This solution works with any aggregation binding. Not only when using a control based on the sap.m.ListBase, which provides properties for specifing the number of records that should be returned.

 

Solution: In the definition of the aggregation binding specify the parameter "length":

 

Example:

Length - Code Snippet.png

In this example a list of the first three business partners should be rendered. Therefor only the first 3 need to be loaded.

This will then result in the following OData Request:

 

    ../BusinessPartnerSet?$skip=0&$top=3


I could not found this feature in the documentation so thats why I'm sharing this with you.


Viewing all articles
Browse latest Browse all 789

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>