on 01-27-2016 2:41 PM
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);
});
var columnCharts = new sap.m.SegmentedButton("cc");
var cc1 = new sap.m.SegmentedButtonItem({key : "cc1"});
cc1.setIcon('./Content/images/AnalyticsPic1.jpg');
cc1.setWidth('50px');
columnCharts.addItem(cc1);
var cc2 = new sap.m.SegmentedButtonItem({key : "cc2" });
cc2.setIcon('./Content/images/AnalyticsPic1.jpg');
cc2.setWidth('50px');
columnCharts.addItem(cc2);
var cc3 = new sap.m.SegmentedButtonItem({key : "cc3"});
cc3.setIcon('./Content/images/AnalyticsPic1.jpg');
cc3.setWidth('50px');
columnCharts.addItem(cc3);
debugger;
columnCharts.placeAt("body", "only");
columnCharts.attachSelect(function (oEvent) {
debugger;
alert("Selected button id: " + columnCharts.getSelectedKey());
});
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Dimitris,
Please refer this post.
http://stackoverflow.com/questions/33235424/segmented-button-openui5-setselectedbutton
JS Bin - Collaborative JavaScript Debugging
Dennis Seah is this a bug?
Regards,
Naren
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
85 | |
10 | |
10 | |
9 | |
7 | |
6 | |
5 | |
5 | |
4 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.