Technology Blogs by Members
Explore a vibrant mix of technical expertise, industry insights, and tech buzz in member blogs covering SAP products, technology, and events. Get in the mix!
cancel
Showing results for 
Search instead for 
Did you mean: 
0 Kudos

We would like to have the index of aggregated element in the template generation. There are a lot of reasons someone needs the index of the aggregation item.

  1. Display the sequence of the item
  2. Display a control when it is the first, last, even or odd template
  3. Pass it as a parameter to an event
  4. Name an object according to the index

As an example we would like to use the index of aggregation in the name of a TextField

_addressEditFormElementTemplate: function(oController) {


     return new sap.ui.commons.form.FormElement(this.createId('fldAddress'), {

            label: new sap.ui.commons.Label(this.createId('lblAddress'), {

                text: 'Address'

                }

            }),

            fields: [

                new sap.ui.commons.TextField(this.createId('inpAddress'), {

                    value: '{address}',

                    name: 'addresses[${index}].address'

                })

          ]

     });

}

Is it possible now?

1 Comment
Labels in this area