Skip to Content
avatar image
Former Member

SAP UI5 Bindings

Hi,experts

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

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

1 Answer

  • Best Answer
    Mar 22, 2017 at 08:10 PM

    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.

    Add comment
    10|10000 characters needed characters exceeded