Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
Clear All
new posts

    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!!!

    #2
    Call focus() on whichever button you want to have focus.

    Comment


      #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

      Comment


        #4
        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.

        Comment


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

          Comment


            #6
            Don't isc.ask() - create an instance of Dialog if you want to customize at this level.

            Comment


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

              Comment


                #8
                Hi Isomorphic,

                Please suggest!!!

                Comment


                  #9
                  Call focus() on the NO button.

                  Comment


                    #10
                    Please provide the example. I am not understanding, where and how to call focus() on ON button.

                    Thanks!!!

                    Comment


                      #11
                      Code:
                      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();

                      Comment

                      Working...
                      X