3

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.

Cœur
  • 37,241
  • 25
  • 195
  • 267
yoav.str
  • 1,547
  • 6
  • 33
  • 73

2 Answers2

3

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().

iluwatar
  • 1,778
  • 1
  • 12
  • 22
0

I would turn off default form processing and control validation manually. See wicket manual