UI5-Radio Button
Creating Two Radio Buttons bound to a single group.
By default none of the button is selected.
To set any one button by default use property: Selected.
An event ‘SELECT’ can be assigned to each of the button .
Each button can be set as- editable,enabled.
Each button a value state can be defined.
Code- Snippet
// Instantiate a radio button
oRadioBtn1 = new sap.ui.commons.RadioButton({
text: “on”,
group: “G1”,
selected: true,
//editable: false,
valueState: sap.ui.core.ValueState.Warning,
select: function(){alert(‘ON Selected’);} // event-select
}).placeAt(“content”);
oRadioBtn2 = new sap.ui.commons.RadioButton({
text: “off”,
group: “G1”,
//enabled: false,
valueState: sap.ui.core.ValueState.Error,
select: function(){alert(‘OFF Selected’);}
}).placeAt(“content”);