UI5- CheckBox
3 check boxed with different properties set for each.
Adding the ValueState property.
Associating a change event to the check box.
Code Snippet:
// Instantiate a check box
oCheckBox1 = new sap.ui.commons.CheckBox({
text: “Share in Facebook”,
//checked: true,
valueState : sap.ui.core.ValueState.Error,
change: function() {if(oCheckBox1.getChecked())
{alert(‘yes’)}
else
{alert(‘no’)}
}
}).placeAt(“content”);
oCheckBox2 = new sap.ui.commons.CheckBox({
text: “Share in Twitter”,
//editable: false,
valueState : sap.ui.core.ValueState.Warning
}).placeAt(“content”);
oCheckBox2 = new sap.ui.commons.CheckBox({
text: “Share in LinkedIn”,
enabled: false
}).placeAt(“content”);