Ticket #1639 (closed enhancement: fixed)

Opened 2 years ago

Last modified 11 months ago

[patch] [CLA needed] Improve in wizard widget for checkPass function

Reported by: miksir@… Owned by: dante
Priority: low Milestone: 1.1
Component: Dojox Version: 0.3
Severity: normal Keywords:
Cc: miksir@…

Description

checkPass of Wizard wait for the error string and display alert. For create own error alert i make some changes (see patch below) Now checkPass can return string (old logics) or false.

diff -ur dojo-0.3.1-core/src/widget/Wizard.js dojo/src/widget/Wizard.js
--- dojo-0.3.1-core/src/widget/Wizard.js        2006-06-13 01:19:37.000000000 +0400
+++ dojo/src/widget/Wizard.js   2006-10-12 13:05:45.000000000 +0400
@@ -192,10 +192,12 @@
        checkPass: function() {
                if (this.passFunction && dojo.lang.isFunction(this.passFunction)) {
                        var failMessage = this.passFunction();
-                       if (failMessage) {
+                       if (typeof(failMessage) == 'string') {
                                alert(failMessage);
                                return false;
                        }
+                       if (typeof(failMessage) == 'boolean')
+                          return failMessage;
                }
                return true;
        },

Change History

Changed 2 years ago by dylan

  • milestone set to 0.4.1

Changed 2 years ago by bill

  • cc miksir@… added
  • summary changed from Improve in wizard widget for checkPass function to [patch] [CLA needed] Improve in wizard widget for checkPass function
  • milestone changed from 0.4.1 to 0.5

Sorry, I don't see the purpose of this change. Can you give an example of when you would use a boolean fail message?

Changed 2 years ago by guest

<div id="wizard1" dojoType="WizardContainer">
   <div dojoType="WizardPane" passFunction="sw_select">
...
   </div>
</div>

<script>
function sw_select() {
   // some checks
   if (ckecks == false) {
       // return "Wrong data entered in tab" // alert message - it's not good
       dojo.byId("error_message").innerHTML = "Wrong data entered in tab";
       return false;
   } 
   return true;
}
</script>

Changed 18 months ago by bill

  • component changed from Widgets to Dojox
  • milestone deleted

Changed 11 months ago by dylan

The Wizard widget was removed from Dojo 1.0 as most of its functionality can be attained through the various layout widgets. Is this something that should be kept open?

Changed 11 months ago by bill

Hmm, I never intended the layout widgets to replace Wizard, I just didn't think that Wizard should be part of Dijit.

Changed 11 months ago by dante

  • owner changed from bill to dante
  • status changed from new to assigned
  • milestone set to 1.1

Changed 11 months ago by dante

  • status changed from assigned to closed
  • resolution set to fixed

(In [11823]) initial port of Wizard widget from 0.4 turns out to be a gutting. Using stack container, was able to remove most of the internal logic, and fix a few things along the way. fixes #1639 and fixes #1639 ... buttons are now dijit.form.Buttons, though still needs localization

Note: See TracTickets for help on using tickets.