Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A

difference between Property binding, Aggregation Binding and Element binding?

what is difference between Property binding, Aggregation Binding and Element binding?

Former Member
Former Member replied

HI Rajesh,

Firstly ,

A binding path can either be absolute (starting with a slash), or relative (starting with a name token)

1. Element Binding:

Here we specify the refrenced object.

eg if you bind company object to a layout, like

var oMatrixLayout = new sap.ui.commons.layout.MatrixLayout();

oMatrixLayout.bindElement("/company");

then all the children of this layout can refer to the context of this object. like suppose company has name attribute, then we can directly pass it to the child like:

oMatrixLayout.createRow(

new sap.ui.commons.Label({text: "Name:"}),

new sap.ui.commons.TextField({value: "{name}"})

);

All the relative bindings within the control and all of its children are resolved relatively

2. Property binding is similar to the context mapping in WebdnyPro. We bind it to a property of the UI. It is automatically updated when its vlaue is changed.

3. Aggregation binding (basically a list) defines a template(a model which others can copy) and this template is cloned for each entry of the list. When we make an entry in the list, a clone of the template is created.When the clone is created, the context is set to the entry in the list. Thus all the binding to the template are resolved relative to the entry. This is maily used for large data sets where we will only clone the current entry and not the complete list.

Regards,

Nikhil

1 View this answer in context
Not what you were looking for? View more on this topic or Ask a question