Try overriding the methods focusView and setInitialFocus in your view, and set your focus in these methods.
Thank you for your reply, but it is still not working. Here's some simple test code demonstrating this
not working:
var MainView = new KONtx.Class({
ClassName: 'MyCustomMainView',
Extends: KONtx.system.SidebarView,
createView: function() {
this.controls.ueiButtonMyButton = new KONtx.control.TextButton({
label: 'MyButton',
id: "ueiButtonMyButton",
guid: "ueiButtonMyButton",
focus: true,
styles: {
vOffset: 150,
textAlign: 'left',
hAlign: 'left',
height: 48,
width: selectionButtonWidth,
},
events: {
onSelect: function(event) {
}
}
}).appendTo(this);
this.controls.ueiButtonMyButton2 = new KONtx.control.TextButton({
label: 'MyButton2',
id: "ueiButtonMyButton2",
guid: "ueiButtonMyButton2",
focus: true,
styles: {
vOffset: 250,
textAlign: 'left',
hAlign: 'left',
height: 48,
width: selectionButtonWidth,
},
events: {
onSelect: function(event) {
}
}
}).appendTo(this);
},
updateView: function() {
},
focusView: function() {
UeiLog("focusView here 1");
var focusresult = this.controls.ueiButtonMyButton2.focus();
UeiLog("focusresult = " + focusresult);
UeiLog("focusView here 2");
},
setInitialFocus: function() {
UeiLog("setInitialFocus here 1");
var focusresult = this.controls.ueiButtonMyButton2.focus();
UeiLog("focusresult = " + focusresult);
UeiLog("setInitialFocus here 2");
},
});