on 06-15-2015 8:00 PM
Hi All,
I have a three radio button which is in form. I want to get the selected radio button values while submit a form. How to do this? I have mentioned my code below. Any help would be greatly appreciated.
var oform = new sap.ui.layout.form.SimpleForm("f1",{
maxContainerCols:4,
editable:true,
content:[
new sap.ui.commons.RadioButtonGroup({
columns:4,
items:[new sap.ui.core.Item({text:"radio1"}),
new sap.ui.core.Item({text:"radio2"}),
new sap.ui.core.Item({text:"radio3"})
]
}),
new sap.ui.commons.Button("b1",{
text:"Submit",
width:"100px",
press:function(){
var selItem = sap.ui.core.Item.getSelectedItem(); // Need to get selected radio button values
}
})
]
});
oform.placeAt("content");
if you want to get text,
oRBG2.getSelectedItem().getText());
2nd example of this link RadioButtonGroup - SAPUI5 Demo Kit
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
Try selectedIndex property or getSelectedButton method of Radio Button Group component to return selected item.
Regards,
Sandro Ramos
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
90 | |
10 | |
10 | |
10 | |
7 | |
7 | |
6 | |
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.