Apologies if this is obvious, but I'm getting confused over how and where onValidateForm() should be used. I have a page with search fields in a form and also a grid for the results.
Currently I have: public void onValidateForm() { if (title == null && issn == null) { searchHoldingsForm.recordError("Please provide a value for Title or ISSN"); } } public void onSubmitFromSearchHoldingsForm() { // perform database access using the form fields... ... However, the onSubmit...() will be called even if there is an error. Ok, I could use a Boolean and set it in onValidate() and then bail out in onSubmit...() if there is an error. Or I suppose I could dispense with onValidateForm() altogether and set the error messages directly in onSubmit...() Or perhaps I should keep onValidateForm() and do the DB stuff in onSuccess()? What is the correct way to proceed and why?