Skip to Content
0

SAPUI5 Complex Binding Syntax used with 'parameters'

Nov 08, 2016 at 01:27 PM

645

avatar image

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:

<TreeTable 
 id="TreeTableBasic"
 rows="{path:'/catalog/clothing', parameters: {arrayNames:['categories']}}"
 selectionMode="MultiToggle"
 enableSelectAll="false"
 ariaLabelledBy="title">
 ....

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.


Regards

Tobias

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

3 Answers

Best Answer
VIPLOVE KHUSHALANI Nov 08, 2016 at 02:29 PM
0

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

thanks

Viplove


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

The parameters option is mostly used to add additional odata options

https://help.sap.com/saphelp_uiaddon10/helpdata/en/91/f11c116f4d1014b6dd926db0e91070/content.htm

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.

Regards,

Jamie

SAP - Technology RIG

Share
10 |10000 characters needed characters left characters exceeded
Tobias Schnur Nov 23, 2016 at 10:23 PM
0

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

Share
10 |10000 characters needed characters left characters exceeded