Use "public void validate(Form form)"
See example below. Hope it helps.
private final class Step2 extends WizardStep {
public Step2() {
setTitleModel(new Model("Add pictures"));
add(new AbstractFormValidator() {
public FormComponent[]
getDependentFormComponents() {
return null;
}
public void validate(Form form) {
String dir =
Constants.ADD_PROJECT_FILE_PIC_PATH +
getProjects().getTblId();
File filesDir = new File(dir);
if (filesDir.canRead() ||
filesDir.isDirectory()) {
String[] fileNames =
filesDir.list();
if (fileNames.length > 0) {
getProjects().setNumPhotos(fileNames.length);
} else {
form.error("Please
upload some photos");
}
} else {
form.error("Please upload some
photos");
}
}
});
}
}
Dave Schoorl wrote:
>
> Hi all,
>
> I am building my first Wizard with the wizard from wicket-extensions
> version 1.3.5. Every step contains a panel with it's own form, so I have
> a nested form in the wizards form. I was expecting that when I click
> next, the onSubmit of my current form is called, but it's not. Instead
> the onSubmit of the form in the next step is called.
>
> This seems to be related: http://markmail.org/message/ktpvzvslq5tupo6x
>
> Am I doing something wrong?
>
> Regards,
> Dave
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [email protected]
> For additional commands, e-mail: [email protected]
>
>
>
--
View this message in context:
http://www.nabble.com/Wizard-and-onSubmit-of-nested-form-tp22375244p22375366.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]