PDA

View Full Version : Panel Validator is gone?



ckessel
04-08-2003, 05:03 PM
What happened to the panel validation feature? I don' t need to validate one field in my UserInputPanel, I need to validate multiple related fields.

MarloV
04-09-2003, 08:58 AM
You can add custom panel validation by creating a panel subclass and overriding the queryExit method. However, the use of panel-level validation only makes sense when you have some control over the panel contents - Otherwise how will you know what is there to validate? That is why we only included field validation, along with pre-defined validations for many field types.

ckessel
04-09-2003, 09:27 AM
It makes sense if your fields are inter-related (e.g input in field A defines the scope of the legal input in field B). In a UserInputPanel I'm not sure how you don't have control over the panel contents. Who, besides me, is going to determine what gets put in the panel?

Thanks for the pointer though, I'll use queryExit().

MarloV
04-09-2003, 09:28 AM
I hope that works for you!

BTW, by 'panel contents', I'm referring to what the end user enters/selects.

ckessel
04-09-2003, 10:45 AM
Sadly, I've run into another complication. After I've validated the input, I want to programatically do something with it (some text manipulation) and set the resulting value in a product bean, before I exit.

This works fine in console/swing mode since queryExit() is called. However, the docs for queryExit() specifically state:

"This method is not called by the framework when the wizard is running in silent mode."

So, do I need to also override exited() and put my text manipulation/set product bean code there?

Also, do Field Validators get called in silent mode?

Jeff Dillon
04-09-2003, 10:49 AM
The following KB article may help...

http://support.installshield.com/kb/view.asp?pcode=MULTI400PEE&articleid=Q105185

ckessel
04-09-2003, 10:52 AM
Ah, thanks! That definately helps.

MarloV
04-09-2003, 10:58 AM
First of all, the end user cannot respond to your User Input Panel in 'silent' mode because the installation is never presented. You have to use an options file, set with the appropriate responses to each field. Since you set these values, there is no validation available for silent mode.

The "Options File Documentation" property in each User Input Panel field is for you to label each field with what the expected response should be. This information automatically gets added to the options file when MultiPlatform generates it (see Chapter 5.6 - Response/Options File in the MultiPlatform User's Guide for how to generate and use a response/options file).

Once you've generated the options file, you then edit it (with any text editor) and set each property's value.

The execute method is the only method called in silent mode.

Hope that helps!