Hello
I would like to update the text into a control using the setText('a text') method inside the events section of a button.
I read the manual but all the samples put a single Log(' a text') instruction inside the events section. Why ?.
Here is my code. Its fails and shows the error message:
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!ERROR!ERROR!ERROR!ERROR!ERROR!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
Type Error: this.controls has no properties (mifile.js line .... )CODEBOX
var MainView = new KONtx.Class({
ClassName: 'MainView',
Extends: KONtx.system.SidebarView,
createView: function() {
this.controls.Boton1 = new KONtx.control.TextButton({
label: "Boton primero",
guid: "boton1ID",
styles: {
width: Theme.viewSpecs.SIDE_BAR.width,
height: KONtx.utility.scale(35),
vOffset: 0,
}
}).appendTo(this);
this.controls.Boton2 = new KONtx.control.TextButton({
label: "Boton segundo",
guid: "boton2ID",
events: {
onSelect: function(event) {
this.controls.Boton1.setText("TEXT CHANGED");
}
},
styles: {
width: Theme.viewSpecs.SIDE_BAR.width,
height: KONtx.utility.scale(35),
vOffset: this.controls.Boton1.outerHeight,
}
}).appendTo(this);
}
});
What is the mistery of the events section? , please help.
Thanks a lot. I apreciate your work.
Raul de Frutos (Spain)
--------------------