code: function (type, args, obj) {
  
              var aButtons = this.cfg.getProperty("buttons"),
                  el = this.lastFormElement;
  
              if (args && args[1]) {
                  Event.stopEvent(args[1]);
              }
  
              if (aButtons && Lang.isArray(aButtons)) {
                  this.focusLastButton();
              } else {
                  if (el) {
                      try {
                          el.focus();
                      } catch(oException) {
                          // Ignore
                      }
                  }
              }
          }
docs: Sets focus to the last element in the Dialog's form or the last
  button defined via the "buttons" configuration property.
  @method focusLast