UI5-Radio Button

lightUI5-Radio Button

 

 


Creating Two Radio Buttons bound to a single group.

1


By default none of the button is selected.

2


3


To set any  one button by default use property: Selected.

4


5


An  event ‘SELECT’ can be assigned to each of the button .

6


789


Each button can be set as- editable,enabled.

10


11


Each button a value state can be defined.

12


13


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”);


 

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s