cancel
Showing results for 
Search instead for 
Did you mean: 

difference between Property binding, Aggregation Binding and Element binding?

Former Member
0 Kudos

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

Accepted Solutions (1)

Accepted Solutions (1)

Former Member

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

Former Member
0 Kudos

Hi Nikhil,

thanks for your reply now it is clear for me.

Regards,

Rajesh Roy

Former Member
0 Kudos

This message was moderated.

Answers (2)

Answers (2)

emp27
Advisor
Advisor
0 Kudos

This message was moderated.

koolspy_ultimate
Active Contributor
0 Kudos

Hi Rajesh,

Binding is nothing but adding data. just like appending data.

For more info from the SAPUI5 SDK documentation, refer to this link Click here.

Property Binding

Aggregation Binding

Element Binding

Regards,

Madhumahesh.

Message was edited by: Michael Appleby