Multiple submit buttonsPage edited by Manos Batsis
Comment:
added tip related to IE and multiple submit input/button elements
Changes (1)
Full ContentWhen we have a form with only one submit button, the default Form's onSubmit() method will be called. If the Form has more than one submit button, then the mechanism works differently.
To have more than one submit buttons in a Form, we need to create custom Button by subclassing from wicket.markup.html.form.Button. We define the custom Button behaviour by overiding the onSubmit() method and add the buttons to the Form. When the user click on any of the buttons, the specific behaviour of the button is executed by calling the button's onSubmit() method followed by execution of form's onSubmit() method. Example: We have a simple Form that contains two submit buttons. The class contructor looks something like this:
public CustomForm(String form) {
add(new OkayButton());
Button cancel = new CancelButton();
cancel.setDefaultFormProcessing(false);
add(cancel);
}
Change Notification Preferences
View Online
|
View Changes
|
Add Comment
|
