Configure number of items loaded by aggregation binding within XML Views

Tags: UI5, Fiori

XML Views represent the layout much better than JS Views in UI5. By default, lists etc. load a restricted number of items through aggregation binding. You can extend this without programming within XML Views. It requires configuration of the binding with the length parameter. This will set the $top option in the underlying OData query. We apply it in the example below for suggestion items of an input field, but you are not restricted; any other aggregation binding can be setup like this. It works with JSON Models too.

<Input id="myInput" type="Text" placeholder="{i18n>pholdType}" showSuggestion="true" 
suggestionItems="{path:'app>/aItems', length: 600 }" width="20rem" maxSuggestionWidth="34rem">
<suggestionItems>
<core:ListItem text="{app>type}" additionalText="{app>typeText} {app>typeLongText}"/>
</suggestionItems>
</Input>

Good thing, that this will not override the size limit setting of your OData Model, however take care of harmonization with the paging settings of specific controls, which have such built in feature like sap.m.List (growingThreshold etc.), where you can reach your goal without the length parameter.