05-05-2020 12:57 PM
How can i add border color to an input box through Controller when i click on a button .
instead of writing in css file can anyone suggest me how to write in controller.js so that when i click a button the border color has to be changed to red .
07-30-2020 9:28 AM
<!--in view-->
<Input id="idInput" change="setState"/>
//in controller
setState: function(){
let inst = this.getView().byId("idInput");
inst.setValueState("Error");
//or
inst.addStyleClass("cls1");
}
//in css file
.cls1{
border-color: red;
}
You can use any of the ways to alter the appetence of the control, For more you can visit SDK for control specific options.
Thanks,
Bharath.