Updated Branches:
  refs/heads/wicket-1.5.x d8de9020a -> 7497e1551

WICKET-4506 Fix missing in 1.4.19, was fixed in 1.3.3: Discrepancy between 
Button implementation of getForm and the code in Form.findSubmittingButton()


Project: http://git-wip-us.apache.org/repos/asf/wicket/repo
Commit: http://git-wip-us.apache.org/repos/asf/wicket/commit/7497e155
Tree: http://git-wip-us.apache.org/repos/asf/wicket/tree/7497e155
Diff: http://git-wip-us.apache.org/repos/asf/wicket/diff/7497e155

Branch: refs/heads/wicket-1.5.x
Commit: 7497e1551cf13d5cf0bf56120f1fb746911daf2d
Parents: d8de902
Author: Martin Tzvetanov Grigorov <[email protected]>
Authored: Fri Apr 20 17:21:31 2012 +0300
Committer: Martin Tzvetanov Grigorov <[email protected]>
Committed: Fri Apr 20 17:21:31 2012 +0300

----------------------------------------------------------------------
 .../org/apache/wicket/markup/html/form/Button.java |   11 +++++++++++
 1 files changed, 11 insertions(+), 0 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/wicket/blob/7497e155/wicket-core/src/main/java/org/apache/wicket/markup/html/form/Button.java
----------------------------------------------------------------------
diff --git 
a/wicket-core/src/main/java/org/apache/wicket/markup/html/form/Button.java 
b/wicket-core/src/main/java/org/apache/wicket/markup/html/form/Button.java
index c506d3b..679e7fb 100644
--- a/wicket-core/src/main/java/org/apache/wicket/markup/html/form/Button.java
+++ b/wicket-core/src/main/java/org/apache/wicket/markup/html/form/Button.java
@@ -103,6 +103,17 @@ public class Button extends FormComponent<String> 
implements IFormSubmittingComp
        }
 
        /**
+        * Override to not throw exception if there is no parent form.
+        *
+        * @return the parent form or {@code null}
+        */
+       @Override
+       public Form getForm()
+       {
+               return Form.findForm(this);
+       }
+
+       /**
         * Gets the defaultFormProcessing property. When false (default is 
true), all validation and
         * formupdating is bypassed and 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

Reply via email to