Hi,

you could use a FormValidator.

Or let your onSubmit() (or any code it forwards to) throw exceptions and register an IRequestCycleListener#onException() to handle exceptions during form submit.

Have fun
Sven


On 29.06.21 17:51, vahid ghasemi wrote:
I want to add form data to the database.
so it's not good to loading data for every input and checks from the
database.
I am using validation and when everything is ok then I connect to the
database for better performance :).
one Idea is to call the onError method into the onSubmit method. but I want
to know is a better way to handle this situation?

On Tue, Jun 29, 2021 at 8:11 PM Maxim Solodovnik <solomax...@gmail.com>
wrote:

Maybe it would be better to perform checks during validation ?

from mobile (sorry for typos ;)


On Tue, Jun 29, 2021, 22:33 vahid ghasemi <vahidghasemi...@gmail.com>
wrote:

Hello
How can I pass an error in an onSubmit method?
I have some errors that can detect in the onSubmit method.
I throw exceptions at end of the onSubmit method.
In the catch block, I call the error method, but after that, I expect to
don't go into the afterOnSubmit method, but he will go and I am getting
the wrong response.


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

Reply via email to