PDA

View Full Version : Errors in Exiting a Custom Wizard Panel in Console Mode



jaystamm
03-20-2003, 02:55 PM
I have a current wizard panel and it prompts the user for input and if the input is "incorrect" I want to exit the wizard. I have the functionality implemented and have tried 2 methods. Here is the basic logic with some actual code I am using:

Method 1:

protected void consoleInteraction(TTYDisplay tty){

...<ALL PROMPTS>...

if(USERINPUT == BAD)
{
getWizard().exit(com.installshield.wizard.ExitCodes.NORMAL_EXIT);
}
}

This method causes an exception to be thrown:
An error occurred during wizard bean change notification:
java.lang.IllegalStateException: WizardService have already been shutdown and cannot be utilized....

Which I assume is due to the Wizard trying to show/print the "Press 1 for Next, 3 to Cancel or 4 to Redisplay [1]" and since it was just exited it can't (which basically sounds like an ISMP bug to me but...)

Method 2:

Instead of exiting the wizard I just set a variable, and on QueryExit I check that variable and then exit if needed. This method throws no exception but The user sees the Press 1 for Next, 3 to Cancel or 4 to Redisplay [1] message and no matter what they press, it exits. Not too user friendly if you ask me, but looks like how it will probably stay.

Unless any of you wonderful people out there can assist me and give me some ideas.

(edited per MarloV's suggestion, problem still exists)

MarloV
03-24-2003, 12:10 PM
if(USERINPUT = BAD)

Try using two equal signs instead of one, like

if(USERINPUT == BAD)

Using only one equal sign actually sets the value.

jaystamm
03-24-2003, 12:24 PM
That was just a typo, and that part is just the logic of how it works, not the actual code. I think the error is because ISMP's code isn't prepared for the Wizard to end inside of ConsoleInteraction.

Jay

jaystamm
04-09-2003, 04:00 PM
Just BTT maybe get some action on this topic...

Anyone have any ideas??

Jay

Jeff Dillon
04-10-2003, 08:49 AM
That is not a good place to exit the wizard. The way it was envisioned for this to be done is instead of suddenly exiting the wizard, simply display a panel which says "bad input" and make the user go back and fix it.

jaystamm
04-10-2003, 03:03 PM
I can agree with that, but are there any workarounds that anyone knows of? Is there anyway that I can just suppress the errors that I cause?

The basic design point I really want is to exit if they don't input things correctly.

Jay

Jeff Dillon
04-10-2003, 03:34 PM
To hide the errors it may work to do...

try{
getWizard().exit(com.installshield.wizard.ExitCodes.NORMAL_EXIT);
}
catch (Throwable th){
//ignore
}

I haven't tried it though.

jaystamm
04-11-2003, 04:28 PM
Still no luck in catching the exception but I got it working using the deprecated:

tty.exit();

I will stick with that and hope it doesn't dissapear on me anytime soon and hope that an exceptionless exit method is available if/when this goes away.

Thanks for all the help!!

Jay