Skip to Content
0
Jan 27, 2016 at 02:41 PM

SegmentedButton doesn't hold the original Ids

131 Views

Hi,

In the following code using the sapUI5 "SegmentedButton", when the event "Select" occurs the actual Buttons' Ids are not the original defined ('cc1', 'cc2') but they are the default Ids ('_button14'...).

var columnCharts = new sap.m.SegmentedButton("cc");

var cc1 = new sap.m.SegmentedButtonItem("cc1");

cc1.setIcon('./Content/images/AnalyticsPic1.jpg');

cc1.setWidth('50px');

columnCharts.addItem(cc1);

var cc2 = new sap.m.SegmentedButtonItem("cc2");

cc2.setIcon('./Content/images/AnalyticsPic1.jpg');

cc2.setWidth('50px');

columnCharts.addItem(cc2);

var cc3 = new sap.m.SegmentedButtonItem("cc3");

cc3.setIcon('./Content/images/AnalyticsPic1.jpg');

cc3.setWidth('50px');

columnCharts.addItem(cc3);

columnCharts.placeAt("chartTypeSelector", "only");

columnCharts.attachSelect(function (oEvent) {

alert("Selected button id: " + oEvent.getParameters().selectedButtonId);

});