dojox/widget/Wizard.js

  • Provides:

    • dojox.widget.Wizard
  • Requires:

    • dijit.layout.StackContainer in common in project dijit
    • dijit.layout.ContentPane in common in project dijit
    • dijit.form.Button in common in project dijit
    • dojo.i18n in common in project dojo
  • dojox.widget.Wizard

    • type
      Function
    • chains:
      • dijit.layout.StackContainer: (prototype)
      • dijit.layout.StackContainer: (call)
      • dijit._Templated: (call)
    • mixins:
      • dijit._Templated.prototype: (prototype)
    • summary
      A set of panels that display sequentially, typically notating a step-by-step
      procedure like an install
  • dojox.widget.Wizard.widgetsInTemplate

    • summary
  • dojox.widget.Wizard.templateString

    • summary
  • dojox.widget.Wizard.nextButtonLabel

    • type
      String
    • summary
      Label override for the "Next" button.
  • dojox.widget.Wizard.previousButtonLabel

    • type
      String
    • summary
      Label override for the "Previous" button.
  • dojox.widget.Wizard.cancelButtonLabel

    • type
      String
    • summary
      Label override for the "Cancel" button.
  • dojox.widget.Wizard.doneButtonLabel

    • type
      String
    • summary
      Label override for the "Done" button.
  • dojox.widget.Wizard.cancelFunction

    • type
      Function|String
    • summary
      Name of function to call if user presses cancel button.
      Cancel button is not displayed if function is not specified.
  • dojox.widget.Wizard.hideDisabled

    • type
      Boolean
    • summary
      If true, disabled buttons are hidden; otherwise, they are assigned the
      "WizardButtonDisabled" CSS class
  • dojox.widget.Wizard.postMixInProperties

    • type
      Function
    • source: [view]
        this.inherited(arguments);
        var labels = dojo.mixin({cancel: dojo.i18n.getLocalization("dijit", "common", this.lang).buttonCancel},
         dojo.i18n.getLocalization("dojox.widget", "Wizard", this.lang));
        var prop;
        for(prop in labels){
         if(!this[prop + "ButtonLabel"]){
          this[prop + "ButtonLabel"] = labels[prop];
         }
        }
    • summary
  • dojox.widget.Wizard.startup

    • type
      Function
    • source: [view]
        if(this._started){
         //console.log('started');
         return;
        }
        this.inherited(arguments);

        
        this.connect(this.nextButton, "onClick", "_forward");
        this.connect(this.previousButton, "onClick", "back");


        if(this.cancelFunction){
         if(dojo.isString(this.cancelFunction)){
          this.cancelFunction = dojo.getObject(this.cancelFunction);
         }
         this.connect(this.cancelButton, "onClick", this.cancelFunction);
        }else{
         this.cancelButton.domNode.style.display = "none";
        }
        this.connect(this.doneButton, "onClick", "done");


        this._subscription = dojo.subscribe(this.id + "-selectChild", dojo.hitch(this,"_checkButtons"));
        this._started = true;
    • summary
  • dojox.widget.Wizard.resize

    • type
      Function
    • source: [view]
        this.inherited(arguments);
        this._checkButtons();
    • summary
  • dojox.widget.Wizard._checkButtons

    • type
      Function
    • source: [view]
        var sw = this.selectedChildWidget;

        
        var lastStep = sw.isLastChild;
        this.nextButton.set("disabled", lastStep);
        this._setButtonClass(this.nextButton);
        if(sw.doneFunction){
         //console.log(sw.doneFunction);
         this.doneButton.domNode.style.display = "";
         if(lastStep){
          this.nextButton.domNode.style.display = "none";
         }
        }else{
         // #1438 issue here.
         this.doneButton.domNode.style.display = "none";
        }
        this.previousButton.set("disabled", !this.selectedChildWidget.canGoBack);
        this._setButtonClass(this.previousButton);
    • summary
  • dojox.widget.Wizard._setButtonClass

    • type
      Function
    • parameters:
      • button: (typeof )
    • source: [view]
        button.domNode.style.display = (this.hideDisabled && button.disabled) ? "none" : "";
    • summary
  • dojox.widget.Wizard._forward

    • type
      Function
    • source: [view]
        if(this.selectedChildWidget._checkPass()){
         this.forward();
        }
    • summary
      callback when next button is clicked
  • dojox.widget.Wizard.done

    • type
      Function
    • source: [view]
        this.selectedChildWidget.done();
    • summary
      Finish the wizard's operation
  • dojox.widget.Wizard.destroy

    • type
      Function
    • source: [view]
        dojo.unsubscribe(this._subscription);
        this.inherited(arguments);
    • summary
  • dojox.widget.Wizard.cancelButton.domNode.style.display

    • summary
  • dojox.widget.Wizard._subscription

    • summary
  • dojox.widget.Wizard._started

    • summary
  • dojox.widget.Wizard.doneButton.domNode.style.display

    • summary
  • dojox.widget.Wizard.nextButton.domNode.style.display

    • summary
  • dojox.widget.WizardPane

    • type
      Function
    • chains:
      • dijit.layout.ContentPane: (prototype)
      • dijit.layout.ContentPane: (call)
    • summary
      A panel in a `dojox.widget.Wizard`
    • description
      An extended ContentPane with additional hooks for passing named
      functions to prevent the pane from going either forward or
      backwards.
  • dojox.widget.WizardPane.canGoBack

    • type
      Boolean
    • summary
      If true, then can move back to a previous panel (by clicking the "Previous" button)
  • dojox.widget.WizardPane.passFunction

    • type
      String
    • summary
      Name of function that checks if it's OK to advance to the next panel.
      If it's not OK (for example, mandatory field hasn't been entered), then
      returns an error message (String) explaining the reason. Can return null (pass)
      or a Boolean (true == pass)
  • dojox.widget.WizardPane.doneFunction

    • type
      String
    • summary
      Name of function that is run if you press the "Done" button from this panel
  • dojox.widget.WizardPane.startup

    • type
      Function
    • source: [view]
        this.inherited(arguments);
        if(this.isFirstChild){ this.canGoBack = false; }
        if(dojo.isString(this.passFunction)){
         this.passFunction = dojo.getObject(this.passFunction);
        }
        if(dojo.isString(this.doneFunction) && this.doneFunction){
         this.doneFunction = dojo.getObject(this.doneFunction);
        }
    • summary
  • dojox.widget.WizardPane._onShow

    • type
      Function
    • source: [view]
        if(this.isFirstChild){ this.canGoBack = false; }
        this.inherited(arguments);
    • summary
  • dojox.widget.WizardPane._checkPass

    • type
      Function
    • source: [view]
        var r = true;
        if(this.passFunction && dojo.isFunction(this.passFunction)){
         var failMessage = this.passFunction();
         switch(typeof failMessage){
          case "boolean":
           r = failMessage;
           break;
          case "string":
           alert(failMessage);
           r = false;
           break;
         }
        }
        return r; // Boolean
    • summary
      Called when the user presses the "next" button.
      Calls passFunction to see if it's OK to advance to next panel, and
      if it isn't, then display error.
      Returns true to advance, false to not advance. If passFunction
      returns a string, it is assumed to be a custom error message, and
      is alert()'ed
    • returns
      Boolean
  • dojox.widget.WizardPane.done

    • type
      Function
    • source: [view]
        if(this.doneFunction && dojo.isFunction(this.doneFunction)){ this.doneFunction(); }
    • summary
  • dojox.widget

    • type
      Object
    • summary
  • dojox

    • type
      Object
    • summary