Search code examples
sapui5

In XML View How to bind items with dynamic values/model properties for the parameters


To restrict the number of items shown in the list, you can pass 2 parameter startIndex,length like this

<List items = "{path: 'model>/Invoices', length: 3, startIndex: 0}">

Can we make the length come from model length:'model>/property' or is it possible to pass js variable into xml


Solution

  • the List supports a "growing" feature where you can surely use binding

    see https://sapui5.hana.ondemand.com/#/entity/sap.m.List/sample/sap.m.sample.ListGrowing

    If you really, really want to cut of more than x Rows, you could set a limit on your Model. see setSizeLimit