spant
October 6, 2011, 5:25pm
1
Hi,
I wanted to use the NO button as a default button, please let me know how to change the default button behavior without changing the sequence of the Button. I wanted to display the YES and NO button in confirmation message. By default, the first button is highlighted ( if use the sequence YSE, NO button).
Please suggest, how to make NO button to be selected/focused without changing the button sequence.
Thanks!!!
Call focus() on whichever button you want to have focus.
spant
October 6, 2011, 6:01pm
3
Thanks !!!
Please let me know the syntax of using focus() so that No button will be focused by default for some of the dialog box
If you call focus() on your button after draw() that’s all that’s needed, however if you want nothing focused you can set dialog.autoFocus to false.
spant
October 6, 2011, 6:10pm
5
Used below to display dialog box :
isc.ask (“message to display”, “execute(value)”, {buttons : [isc.Dialog .YES,isc.Dialog .NO], title: “Execute”});
How to use the focus() to set the focus on ‘NO’ Button?
Thanks.
Don’t isc.ask() - create an instance of Dialog if you want to customize at this level.
spant
October 6, 2011, 6:24pm
7
isc.Dialog .create({
message : “Please choose whether to proceed”,
icon:“[SKIN]ask.png”,
buttons : [
isc.Button .create({ title:“YES” }),
isc.Button .create({ title:“NO” })
],
buttonClick : function (button, index) {
this.hide();
}
});
How to set focus to NO?.
Call focus() on the NO button.
spant
October 6, 2011, 11:56pm
10
Please provide the example. I am not understanding, where and how to call focus() on ON button.
Thanks!!!
var noButton = isc.Button.create({ title:"NO" });
isc.Dialog.create({
message : "Please choose whether to proceed",
icon:"[SKIN]ask.png",
buttons : [
noButton,
isc.Button.create({ title:"YES" })
],
buttonClick : function (button, index) {
this.hide();
}
});
noButton.focus();