wizard
  1. wizard
  2. WIZARD-26

Wizard does not go back after reporting problem on finish of WizardPanelProvider

    Details

    • Type: Bug Bug
    • Status: Open
    • Priority: Major Major
    • Resolution: Unresolved
    • Affects Version/s: current
    • Fix Version/s: milestone 1
    • Component/s: www
    • Labels:
      None
    • Environment:

      Operating System: Windows XP
      Platform: PC

    • Issuezilla Id:
      26

      Description

      I have a WizardPanelProvider which after going through a set of wizards makes a
      saving call to a server on the "finish" method. What I'm trying to is if the
      server comes back with a validation exception, I want to report that to the user
      and then be able to click on the "back" button and go back to a previous panel
      to fix it.

      The problem is shown but even though the "< Prev" button is enabled, it does
      nothing. i.e. clicking on it does not take me back to previous panel.

      When I click next i get the following exception:

      Exception occurred during event dispatching:
      java.lang.IllegalStateException: Exception said to return to _#UndeterminedStep
      but no such step found
      at
      org.netbeans.api.wizard.displayer.NavButtonManager.processFinishProceed(NavButtonManager.java:531)
      at
      org.netbeans.api.wizard.displayer.NavButtonManager.processFinish(NavButtonManager.java:457)
      at
      org.netbeans.api.wizard.displayer.NavButtonManager.actionPerformed(NavButtonManager.java:277)
      at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:1995)
      at javax.swing.AbstractButton$Handler.actionPerformed(AbstractButton.java:2318)
      at
      javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:387)
      at javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:242)
      at
      javax.swing.plaf.basic.BasicButtonListener.mouseReleased(BasicButtonListener.java:236)
      at java.awt.Component.processMouseEvent(Component.java:6041)
      at javax.swing.JComponent.processMouseEvent(JComponent.java:3265)
      at java.awt.Component.processEvent(Component.java:5806)
      at java.awt.Container.processEvent(Container.java:2058)
      at java.awt.Component.dispatchEventImpl(Component.java:4413)
      at java.awt.Container.dispatchEventImpl(Container.java:2116)
      at java.awt.Component.dispatchEvent(Component.java:4243)
      at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4322)
      at java.awt.LightweightDispatcher.processMouseEvent(Container.java:3986)
      at java.awt.LightweightDispatcher.dispatchEvent(Container.java:3916)
      at java.awt.Container.dispatchEventImpl(Container.java:2102)
      at java.awt.Window.dispatchEventImpl(Window.java:2440)
      at java.awt.Component.dispatchEvent(Component.java:4243)
      at java.awt.EventQueue.dispatchEvent(EventQueue.java:599)
      at
      java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:273)
      at
      java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:183)
      at
      java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:177)
      at java.awt.Dialog$1.run(Dialog.java:1045)
      at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:209)
      at java.awt.EventQueue.dispatchEvent(EventQueue.java:597)
      at
      java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:273)
      at
      java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:183)
      at
      java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:173)
      at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:168)
      at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:160)
      at java.awt.EventDispatchThread.run(EventDispatchThread.java:121)
      Caused by: java.util.NoSuchElementException: Cannot back out past first entry
      at org.netbeans.modules.wizard.MergeMap.popAndCalve(MergeMap.java:112)
      at
      org.netbeans.api.wizard.displayer.NavButtonManager.processFinishProceed(NavButtonManager.java:523)
      ... 33 more
      Exception occurred during event dispatching:
      java.util.NoSuchElementException: Cannot back out past first entry
      at org.netbeans.modules.wizard.MergeMap.popAndCalve(MergeMap.java:112)
      at
      org.netbeans.api.wizard.displayer.NavButtonManager.processPrevProceed(NavButtonManager.java:432)
      at
      org.netbeans.api.wizard.displayer.NavButtonManager.processPrev(NavButtonManager.java:416)
      at
      org.netbeans.api.wizard.displayer.NavButtonManager.actionPerformed(NavButtonManager.java:273)
      at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:1995)
      at javax.swing.AbstractButton$Handler.actionPerformed(AbstractButton.java:2318)
      at
      javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:387)
      at javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:242)
      at
      javax.swing.plaf.basic.BasicButtonListener.mouseReleased(BasicButtonListener.java:236)
      at java.awt.Component.processMouseEvent(Component.java:6041)
      at javax.swing.JComponent.processMouseEvent(JComponent.java:3265)
      at java.awt.Component.processEvent(Component.java:5806)
      at java.awt.Container.processEvent(Container.java:2058)
      at java.awt.Component.dispatchEventImpl(Component.java:4413)
      at java.awt.Container.dispatchEventImpl(Container.java:2116)
      at java.awt.Component.dispatchEvent(Component.java:4243)
      at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4322)
      at java.awt.LightweightDispatcher.processMouseEvent(Container.java:3986)
      at java.awt.LightweightDispatcher.dispatchEvent(Container.java:3916)
      at java.awt.Container.dispatchEventImpl(Container.java:2102)
      at java.awt.Window.dispatchEventImpl(Window.java:2440)
      at java.awt.Component.dispatchEvent(Component.java:4243)
      at java.awt.EventQueue.dispatchEvent(EventQueue.java:599)
      at
      java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:273)
      at
      java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:183)
      at
      java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:177)
      at java.awt.Dialog$1.run(Dialog.java:1045)
      at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:209)
      at java.awt.EventQueue.dispatchEvent(EventQueue.java:597)
      at
      java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:273)
      at
      java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:183)
      at
      java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:173)
      at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:168)
      at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:160)
      at java.awt.EventDispatchThread.run(EventDispatchThread.java:121)

      You can reproduce it with the following attached code. Run the
      "GatewayWizardBranchController" class (just ensure u have ur wizard.jar and
      jgoodies forms.jar vs 1.2.0 in your path -
      http://www.jgoodies.com/downloads/libraries.html).

      Fill in required fields, on page 2 just go next, on page 3, after filling in
      field 1, press finish, an exception will be thrown.

      regards
      Jose

        Activity

        Hide
        correij added a comment -

        Created an attachment (id=3)
        rar file containing code to reproduce bug

        Show
        correij added a comment - Created an attachment (id=3) rar file containing code to reproduce bug
        Hide
        correij added a comment -

        The problem seems to be that, in method "processFinishProceed" of
        NavButtonManager under the "catch (WizardException we)" block, you do not seem
        to cater for step Wizard.UNDETERMINED_STEP because this is the step defaulted to
        when I instantiate a WizardException object without a step id as the second
        parameter (i.e. if I only use the constructor with the one parameter which I was).

        So I think the code thereafter has to be improved in the following way:

        1. Original:
        String id = we.getStepToReturnTo();
        String curr = settings.currID();
        try
        {
        while (id != null && !id.equals(curr))

        { curr = settings.popAndCalve(); }

        settings.push(id);
        parent.navigateTo(id);
        return;
        }

        2. My solution:
        String id = we.getStepToReturnTo();

        if (id != null && !id.equals(Wizard.UNDETERMINED_STEP)) {
        String curr = settings.currID();
        try
        {
        while (!id.equals(curr))

        { curr = settings.popAndCalve(); }

        settings.push(id);
        parent.navigateTo(id);
        return;
        }

        i.e. don't do a thing, besides reporting error, if id is not specifically
        specified. What do you think?

        Show
        correij added a comment - The problem seems to be that, in method "processFinishProceed" of NavButtonManager under the "catch (WizardException we)" block, you do not seem to cater for step Wizard.UNDETERMINED_STEP because this is the step defaulted to when I instantiate a WizardException object without a step id as the second parameter (i.e. if I only use the constructor with the one parameter which I was). So I think the code thereafter has to be improved in the following way: 1. Original: String id = we.getStepToReturnTo(); String curr = settings.currID(); try { while (id != null && !id.equals(curr)) { curr = settings.popAndCalve(); } settings.push(id); parent.navigateTo(id); return; } 2. My solution: String id = we.getStepToReturnTo(); if (id != null && !id.equals(Wizard.UNDETERMINED_STEP)) { String curr = settings.currID(); try { while (!id.equals(curr)) { curr = settings.popAndCalve(); } settings.push(id); parent.navigateTo(id); return; } i.e. don't do a thing, besides reporting error, if id is not specifically specified. What do you think?

          People

          • Assignee:
            wizard-issues
            Reporter:
            correij
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated: