on 2016 Jan 18 2:35 PM
Hi,
I have 2 checkboxes on the screen(checkbox1,checkbox2), my requireemnt is to by default checkbox1 is selected, which is done . now when checkbox2 is selected then checkbox 1 gets unchecked , and vice a versa.
code i m writting for the same is :
// create a simple CheckBox
new sap.ui.commons.CheckBox({
id : "checkbox1",
text : "checkbox1",,
tooltip : 'Commercial Customer',
checked : false,
enabled : true,
change : function(){
alert("commercial selected");
sap.ui.getCore().byId("checkbox2").setChecked(false);
}
new sap.ui.commons.CheckBox({
id : "checkbox2",
checked : true,
enabled : true,
change : function(){
alert("residentail selected");
sap.ui.getCore().byId("checkbox1").setChecked(false);
}
Alers are coming but the toggling of the checkboxes are not working.
Secondly in additons to this I have to make some fields visible or hidden.
Thanks in advance
Pooja
Request clarification before answering.
Hi,
You have here a working example:
http://jsbin.com/hidafu/edit?html,js,console,output
For visible or not, you can use the method setVisible.
Regards
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I would suggest using a radio button group for this. Most people would not expect checkboxes to work this way and may be confused. An example of a radio button group can be found at
Regards,
Jamie
SAP - Technology RIG
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.
| User | Count |
|---|---|
| 5 | |
| 5 | |
| 4 | |
| 3 | |
| 3 | |
| 2 | |
| 2 | |
| 2 | |
| 1 | |
| 1 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.