Have you tried #setDefaultFormProcessing(false)? Otherwise the button will trigger new validation errors.
Sven > > On 19.02.2019 at 10:36, <Casper Kent> wrote: > > > I am trying to implement a "Clear" button on a form that will clear the > input fields as well as any feedback messages. The fields are clear with > form.clearInput() but the feedback messages are not. This is done with a > AjaxButton. I thought when the feedback panel is added to the target, it will > make the messages disappeared but it does not. Here is the relevant code: > form.add(new AjaxButton("clearButton") { @Override protected void > onSubmit(AjaxRequestTarget target) { form.clearInput(); target.add(form); > target.add(feedback); } @Override protected void onError(AjaxRequestTarget > target) { form.clearInput(); target.add(form); target.add(feedback); } }); >