Skip to Content
0

SAP UI5 Bindings

Mar 22, 2017 at 06:20 PM

54

avatar image
Former Member

Hi,experts

May i know the exact use of property,aggregation⪙ement binding? in which scenarios which one preferable?

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

1 Answer

Best Answer
Jun Wu Mar 22, 2017 at 08:10 PM
0

there is no preference(you can consider they are exclusive). they are for different scenario. you only choose one.

{property1:value1,property2:{subp1:subv1,subp2:subv2},property3:[]}

imagine you have that data object,

1.key:value

2.key:object

3.key:array

1.if you have a standalone input field, you can use bindproperty to bind the input field to the model property

2.if you have a form, you can use bindelement to bind the form to element(property2 in our case), then for the fields in the form, they can use relative binding. form.bindElement("/property2"). fieldintheform.bindproperty("subp1"). of course you can use following fieldintheform.bindproperty("/property2/subp1"). but using relative binding, it saves u a little bit.

3. Aggregation binding is used to automatically create child controls according to model data. like table, dropdown.

Share
10 |10000 characters needed characters left characters exceeded