THIS IS A TEST INSTANCE. ALL YOUR CHANGES WILL BE LOST!!!!
...
Code Block | ||||
---|---|---|---|---|
| ||||
<form ...> <input type="submit" wicket:id="okbutton" value="OK" /> <input type="submit" wicket:id="cancelbutton" value="Cancel" /> </form> |
Alternatively, you could use form's onSubmit() method for the submit triggered by OK button and button's onSubmit() method for the submit triggered by the Cancel button.
Code Block |
---|
private static class MyForm extends Form {
public MyForm(String name) {
super(name);
add(new Button("okbutton"));
Button cancel = new Button("cancelbutton"){
protected void onSubmit() {
info("Cancel was pressed!");
}
};
cancel.setDefaultFormProcessing(false);
add(cancel);
}
protected void onSubmit() {
info("OK was pressed!");
}
}
|