SV: onSubmit method and validators

2010-11-10 Thread Wilhelmsen Tor Iver

 The issue I am having is that once this happens, the onSubmit() method
 is no longer called and wicket starts calling the onError() method.

Which is as expected: You usually do not want to process a form that fails 
validation.

 Since my business logic is inside the onSubmit() method, it never gets called.

What business logic do you want to run on invalid form data? Try looking into 
running that code in some of the other lifecycle-oriented methods like 
onBeforeRender() or the like.

- Tor Iver


SV: onSubmit method and validators

2010-11-10 Thread Wilhelmsen Tor Iver
 
 Isn't this the logical place to put this code?

Yes, once all validation has passed, you will want to persist the correct data.

 Once the user leaves out a certain input, onError() is called and
 onSubmit() never gets called again.

Strange, it should be called on the next submit if the user fills it in... is 
the issue that it never accepts the value after that? Remember, you as a coder 
has told the form that the field is required before the data is acceptable. If 
you want the data to be submitted to onSubmit() anyway you need to remove the 
instruction to the validator and instead have a check in onSubmit that 
presents a warning that the field really ought to have been filled out..

- Tor Iver