Show us your code and I'll see if I can help.


Dave Schoorl wrote:
> 
> Hi Robert, thanks for your quick reply.
> 
> I am not sure if I understand what you mean. How is form validation 
> helping with the trigger of onSubmit() on the correct form?
> But I gave it a try and the problem remains: the onSubmit of the next 
> step is called instead of the current step. I think that first the panel 
> of the current step is replaced with the panel of the next step and then 
> the onSubmit is executed.
> 
> Hope someone can help me.
> 
> Regards,
> Dave
> 
> 
> rmattler wrote:
>> 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: users-unsubscr...@wicket.apache.org
>>> For additional commands, e-mail: users-h...@wicket.apache.org
>>>
>>>
>>>
>>>     
>>
>>   
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
> For additional commands, e-mail: users-h...@wicket.apache.org
> 
> 
> 

-- 
View this message in context: 
http://www.nabble.com/Wizard-and-onSubmit-of-nested-form-tp22375244p22388940.html
Sent from the Wicket - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org

Reply via email to