Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Code Block
Button submit = new Button("submit") {
    public void onSubmit() {
        // handle form submission
    }
}
form.add(submit);

TextField foo = new TextField("foo") {
    public boolean isRequired() {
        Form form = (Form) findParent(Form.class);
        return form.getRootForm().findSubmittingButton() == submitButtonbutton;
    }
}
form.add(foo);

Note the call to getRootForm. Technically, this is only required in nested forms.

...