Confimation Dialog : How to set default focus to button 'No'

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.

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.

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.

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?.

Hi Isomorphic,

Please suggest!!!

Call focus() on the NO button.

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();