Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

wicket - two submit buttons with different validation

I am using two AjaxButton for the same grid where both of them are not in the form but attached to it.

activateButton = new AjaxButton(ACTIVATE_BUTTON, grid.getForm())

blockButton = new AjaxButton(BLOCK_BUTTON, grid.getForm())

my problem is trying to give each one of them different validation, when the form is submitted i am getting all the buttons validation instead of getting just one of them as I want.

like image 436
yoav.str Avatar asked Mar 24 '26 12:03

yoav.str


1 Answers

For each of the buttons you can disable the default form processing using AjaxButton.setDefaultFormProcessing() and handle the validation directly in the button by overriding AjaxButton.onSubmit().

like image 86
iluwatar Avatar answered Mar 28 '26 02:03

iluwatar



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!