Skip to Content
0
Former Member
Apr 23, 2014 at 06:44 AM

How to get ID for aggregated Controls?

354 Views

Hi folks,

I have created a custom control. The custom control have few aggregations like textView and Labels and Buttons. I did the aggregation binding for label and Text View. Which looks something like this -

oControl.bindAggregation("data","/dataList",new sap.ui.commons.TextView({id:"Some random number id ",text:"{data}"}));
oControl.bindAggregation("label","/dataList",new sap.ui.commons..Label("The Data");
oControl.bindAggregation("deleteButton","/dataList",new sap.ui.commons.Button("Delete this!!");

Now When I want to fetch the id of data to delete the data on click of delete button. How can I get the id of text view Considering that there are 5 data bound to the control by aggreagation binding. Whenever I do oEvent.getSource().getId() i get the same button id every time. I am expecting to get different button id for each aggregated data set and button. Any suggestions or pointer's would be appreciated.

Thanks & Regards

Jeetendra