| 1 |
define([ |
| 2 |
"dojo/_base/lang", |
| 3 |
"dojo/_base/declare", |
| 4 |
"dijit/layout/ContentPane" |
| 5 |
], function(lang, declare, ContentPane){ |
| 6 |
|
| 7 |
return declare("dojox.widget.WizardPane", ContentPane, { |
| 8 |
|
| 9 |
|
| 10 |
|
| 11 |
|
| 12 |
|
| 13 |
|
| 14 |
|
| 15 |
|
| 16 |
|
| 17 |
canGoBack: true, |
| 18 |
|
| 19 |
|
| 20 |
|
| 21 |
|
| 22 |
|
| 23 |
|
| 24 |
passFunction: null, |
| 25 |
|
| 26 |
|
| 27 |
|
| 28 |
doneFunction: null, |
| 29 |
|
| 30 |
startup: function(){ |
| 31 |
this.inherited(arguments); |
| 32 |
if(this.isFirstChild){ this.canGoBack = false; } |
| 33 |
if(lang.isString(this.passFunction)){ |
| 34 |
this.passFunction = lang.getObject(this.passFunction); |
| 35 |
} |
| 36 |
if(lang.isString(this.doneFunction) && this.doneFunction){ |
| 37 |
this.doneFunction = lang.getObject(this.doneFunction); |
| 38 |
} |
| 39 |
}, |
| 40 |
|
| 41 |
_onShow: function(){ |
| 42 |
if(this.isFirstChild){ this.canGoBack = false; } |
| 43 |
this.inherited(arguments); |
| 44 |
}, |
| 45 |
|
| 46 |
_checkPass: function(){ |
| 47 |
|
| 48 |
|
| 49 |
|
| 50 |
|
| 51 |
|
| 52 |
|
| 53 |
|
| 54 |
var r = true; |
| 55 |
if(this.passFunction && lang.isFunction(this.passFunction)){ |
| 56 |
var failMessage = this.passFunction(); |
| 57 |
switch(typeof failMessage){ |
| 58 |
case "boolean": |
| 59 |
r = failMessage; |
| 60 |
break; |
| 61 |
case "string": |
| 62 |
alert(failMessage); |
| 63 |
r = false; |
| 64 |
break; |
| 65 |
} |
| 66 |
} |
| 67 |
return r; |
| 68 |
}, |
| 69 |
|
| 70 |
done: function(){ |
| 71 |
if(this.doneFunction && lang.isFunction(this.doneFunction)){ this.doneFunction(); } |
| 72 |
} |
| 73 |
}); |
| 74 |
|
| 75 |
}); |
| 76 |
|