Javascript 单选按钮组->应该给-.setSelected()赋予什么值

Javascript 单选按钮组->应该给-.setSelected()赋予什么值,javascript,radio-button,sapui5,Javascript,Radio Button,Sapui5,为了在RadioButtonGroup构造中选择特定的按钮,应给出.setSelectedButton的值类型 我尝试的是: sap.ui.getCore().byId("RadioButtonGroup").setSelectedButton("idOftheButton") 预期结果:它选择此特定按钮 实际结果:错误根据文档,setSelectedButton的参数是sap.m.RadioButton对象本身,因此取决于您注册和声明所有内容的方式,它更接近: var button = sa

为了在RadioButtonGroup构造中选择特定的按钮,应给出.setSelectedButton的值类型

我尝试的是:

sap.ui.getCore().byId("RadioButtonGroup").setSelectedButton("idOftheButton")
预期结果:它选择此特定按钮
实际结果:错误根据文档,setSelectedButton的参数是sap.m.RadioButton对象本身,因此取决于您注册和声明所有内容的方式,它更接近:

var button = sap.ui.getCore().byId("idOftheButton"); //find the button
sap.ui.getCore().byId("RadioButtonGroup").setSelectedButton(button);