Hi Matthias, thanks! I used error(), but the wizard didn't stop. I will check it, maybe I use a ref-Object to call error().
regards - jk Matthias Keller wrote: > > [email protected] wrote: >> Hi, >> >> when I validate the data of a WizardStep after pressing Next, I >> navigate within the validate method to the WizardStep.previous() >> step in the false case. >> >> Works fine! But calling the method WizardStep.previous() works >> not for the first Wizard step. That's ok, there is no previous >> one. >> But how can I do it right? >> > Hi > > Not sure why you even want to call next or previous at all manually? > I'm using 1.3.5 so that may make a difference but we're just adding > validators to the WizardStep which takes care of everything. We never > have to manually call previous() or next() ? > > We're just doing: > > add(new FormValidator() { > public FormComponent[] getDependentFormComponents() { > return new FormComponent[] { radioGroup, checkbox }; > } > public void validate (Form form) { > if (isSelected(radioGroup, radio1)) { > if (isChecked(checkbox)) { > error(checkbox, "our.error"); > } > } > } > }); > > Note that FormValidator is our implementation of AbstractFormValidator > which is just there to provide some helper methods like the isSelected() > and isChecked() plus some optimizations. > Now when the error() is called, the wizard won't go to the next step. > > Matt > > -- > [email protected] +41 44 268 83 98 > Ergon Informatik AG, Kleinstrasse 15, CH-8008 Zürich > http://www.ergon.ch > ______________________________________________________________ > e r g o n smart people - smart software > > Ergon ist im Final für den Fairnesspreis 2009 - Online-Abstimmung bis 6. > Mai 2009 unter www.fairnesspreis.ch > > > > > -- View this message in context: http://www.nabble.com/Validate%2C-Navigate-Wizards-tp23364393p23364909.html Sent from the Wicket - User mailing list archive at Nabble.com. --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
