Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » scout » Wizard prevent next step
Wizard prevent next step [message #991811] Thu, 20 December 2012 08:55 Go to next message
Bertin Kiekebosch is currently offline Bertin Kiekebosch
Messages: 305
Registered: August 2011
Senior Member
Hi,

I have a wizard with multiple steps (every step with its own form). I want the user only to be able to go to the next step if he has filled in a particular field on a form. How to do that.

Regards Bertin

Re: Wizard prevent next step [message #991840 is a reply to message #991811] Thu, 20 December 2012 10:14 Go to previous message
Beat Schwarzentrub is currently offline Beat Schwarzentrub
Messages: 43
Registered: November 2010
Member
Set "getConfiguredMandatory()" of that field to "true". Then, when the form is stored in the execDeactivate() method of your step, the form is validated automatically and a message is shown to the user. Technically, a VetoException is thrown which stops the wizard from advancing one step.

If you do not want to store the form (yet), as I assume by your last question, call the validation manually:

  @Override
  protected void execDeactivate(int stepKind) throws ProcessingException {
    if (stepKind == IWizardStep.STEP_NEXT) {
      getForm().validateForm(); // may throw a VetoException
    }
  }


Beat
Previous Topic:Using same formData on multiple forms
Next Topic:Deploying RAP UI on tomcat6
Goto Forum:
  


Current Time: Thu Oct 02 08:41:15 GMT 2014

Powered by FUDForum. Page generated in 0.20663 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software