应该提供.setSelectedButton
什么样的值,以便在RadioButtonGroup
构造中选择特定的按钮。
我尝试过的事情:
sap.ui.getCore().byId("RadioButtonGroup").setSelectedButton("idOftheButton")
预期结果:It selects this specific Button
实际结果:Error
答案 0 :(得分:1)
根据文档,setSelectedButton
的参数是sap.m.RadioButton
对象本身,因此取决于您如何注册和声明所有内容,它更接近:
var button = sap.ui.getCore().byId("idOftheButton"); //find the button
sap.ui.getCore().byId("RadioButtonGroup").setSelectedButton(button);
https://sapui5.netweaver.ondemand.com/sdk#/api/sap.m.RadioButtonGroup/methods/setSelectedButton