Author: ivaynberg
Date: Mon Mar 17 12:00:35 2008
New Revision: 638021

URL: http://svn.apache.org/viewvc?rev=638021&view=rev
Log:
WICKET-1430: Form processing throws NPE if button.onsubmit() moves the button 
or its parents out of the component hierarchy

Modified:
    
wicket/trunk/jdk-1.4/wicket/src/main/java/org/apache/wicket/markup/html/form/Form.java

Modified: 
wicket/trunk/jdk-1.4/wicket/src/main/java/org/apache/wicket/markup/html/form/Form.java
URL: 
http://svn.apache.org/viewvc/wicket/trunk/jdk-1.4/wicket/src/main/java/org/apache/wicket/markup/html/form/Form.java?rev=638021&r1=638020&r2=638021&view=diff
==============================================================================
--- 
wicket/trunk/jdk-1.4/wicket/src/main/java/org/apache/wicket/markup/html/form/Form.java
 (original)
+++ 
wicket/trunk/jdk-1.4/wicket/src/main/java/org/apache/wicket/markup/html/form/Form.java
 Mon Mar 17 12:00:35 2008
@@ -1319,9 +1319,9 @@
                Form formToProcess = this;
                if (submittingComponent != null)
                {
-                       submittingComponent.onSubmit();
                        // use the form which the submittingComponent has 
submitted for further processing
                        formToProcess = submittingComponent.getForm();
+                       submittingComponent.onSubmit();
                }
 
                // Model was successfully updated with valid data
@@ -1368,13 +1368,12 @@
 
 
        /**
-        * Gets the HTTP submit method that will appear in form markup. If no 
method is specified in 
-        * the template, "post" is the default. Note that the markup-declared 
HTTP method may not
-        * correspond to the one actually used to submit the form; in an Ajax 
submit, for example, 
-        * JavaScript event handlers may submit the form with a "get" even when 
the form method is 
-        * declared as "post." Therefore this method should not be considered a 
guarantee of the 
-        * HTTP method used, but a value for the markup only.
-        * Override if you have a requirement to alter this behavior.
+        * Gets the HTTP submit method that will appear in form markup. If no 
method is specified in the
+        * template, "post" is the default. Note that the markup-declared HTTP 
method may not correspond
+        * to the one actually used to submit the form; in an Ajax submit, for 
example, JavaScript event
+        * handlers may submit the form with a "get" even when the form method 
is declared as "post."
+        * Therefore this method should not be considered a guarantee of the 
HTTP method used, but a
+        * value for the markup only. Override if you have a requirement to 
alter this behavior.
         * 
         * @return the submit method specified in markup.
         */


Reply via email to