Skip to Content

SAPUI5 Complex Binding Syntax used with 'parameters'

Nov 08, 2016 at 01:27 PM


avatar image
Former Member

Hi Experts,

when I recently browsed the SAPUI5 Explored section I found some code in the tree table (XML View for Tree Table) I didn't understand:

 rows="{path:'/catalog/clothing', parameters: {arrayNames:['categories']}}"

It aparrently uses a complex binding syntax for the "rows" aggregation. I am familiar with the "path" notation along with formatters. But I never saw the "parameters" notation before. Can someone enlighten me and provide some information about it? I could not find some documentation in the SAPUI5 developers guide.



10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

3 Answers

Best Answer
avatar image
Former Member Nov 08, 2016 at 02:29 PM

Hi Tobias ,

Actually these are binding related parameters. These parameters depends on type of binding (json,oData,oDatav2,oDatav4). Like if you check the second sample of the tree table on explorer (oDataV2 Tree Binding Example) there you find treeAnnotationProperties and countMode as parameters so these are parameters of oData V2 model binding.

For any binding method(binAggreagtion,bindItem) we have parameter field to pass binding dependent parameters to the binding (of any type) as marked in screenshot

So every type of model binding have some extra parameters which we can pass to configure(operations,filtering,annotations,count,binding mode etc) the data according to our needs before attaching to the control .

So for Json tree binding we have this arrayNames parameter similarly for ODataTreeBinding V2 we have treeAnnotationProperties and ODataBinding V2 we have countMode.

Check these api References for the parameters of different bindings (i think jsonBinding or JSONTreeBinding we don't have such doc but if you check out these api references of other types of bindings you will understand what parameter field is all about in binding ):

1. sap.ui.model.odata.v2.ODataTreeBinding

2. sap.ui.model.odata.v2.ODataListBinding

3. sap.ui.model.odata.v4.ODataListBinding

4. sap.ui.model.odata.ODataListBinding



10 |10000 characters needed characters left characters exceeded
Jamie Cawley
Nov 08, 2016 at 02:15 PM

The parameters option is mostly used to add additional odata options

The arrayNames is specific to the tree

* @see sap.ui.model.Model.prototype.bindTree * * @param {object} * [mParameters=null] additional model specific parameters (optional) * If the mParameter <code>arrayNames</code> is specified with an array of string names this names will be checked against the tree data structure * and the found data in this array is included in the tree but only if also the parent array is included. * If this parameter is not specified then all found arrays in the data structure are bound. * If the tree data structure doesn't contain an array you don't have to specify this parameter.



SAP - Technology RIG

10 |10000 characters needed characters left characters exceeded
avatar image
Former Member Nov 23, 2016 at 10:23 PM

Thank you very much. I am familiar with OData Binding Parameters. Just couldn't make the connection here. Big Thanks!

10 |10000 characters needed characters left characters exceeded