# wicket.markup.html.form.Button

[back to the reference]

Within a form, you can nest Button components. Note that you don't have to do this to let the form work (a simple <input type="submit".. suffices), but if you want to have different kinds of submit behaviour it might be a good idea to use Buttons.

When you add a Wicket Button to a form, and that button is clicked, by default the button's onSubmit method is called first, and after that the form's onSubmit button is called. If you want to change this (e.g. you don't want to call the form's onSubmit method, or you want it called before the button's onSubmit method), you can override Form.delegateSubmit.

One other option you should know of is the 'defaultFormProcessing' property of Button components. When you set this to false (default is true), all validation and form updating is bypassed, the onSubmit method of that button is called directly, and the onSubmit method of the parent form is not called. A common use for this is to create a cancel button.

feedbackmessages will be put here panel contents come here