I've created a checkbox and set its default value to true
. on that checkbox select, even I can get the value of that checkbox, either it's checked or not.
But from other methods in controller, how I can get the value? I tried different ways but still unable to get value.
onChangeCheckbox: function(event){
var value = this.byId("chkMyTest").getSelected();
}
Uncaught (in promise) TypeError: Cannot read property 'byId' of undefined
If you are using XML views, then it should be:
var value = this.byId("chkMyTest").getSelected();
Where this
refers to your controller.