Author: jcompagner
Date: Mon Mar 24 04:22:42 2008
New Revision: 640382

URL: http://svn.apache.org/viewvc?rev=640382&view=rev
Log:
button will not throw a exception when Form is not found, 
(Form.findSubmittingComponent is not expecting this) 
WICKET-1414

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

Modified: 
wicket/trunk/jdk-1.4/wicket/src/main/java/org/apache/wicket/markup/html/form/Button.java
URL: 
http://svn.apache.org/viewvc/wicket/trunk/jdk-1.4/wicket/src/main/java/org/apache/wicket/markup/html/form/Button.java?rev=640382&r1=640381&r2=640382&view=diff
==============================================================================
--- 
wicket/trunk/jdk-1.4/wicket/src/main/java/org/apache/wicket/markup/html/form/Button.java
 (original)
+++ 
wicket/trunk/jdk-1.4/wicket/src/main/java/org/apache/wicket/markup/html/form/Button.java
 Mon Mar 24 04:22:42 2008
@@ -16,6 +16,7 @@
  */
 package org.apache.wicket.markup.html.form;
 
+import org.apache.wicket.WicketRuntimeException;
 import org.apache.wicket.markup.ComponentTag;
 import org.apache.wicket.model.IModel;
 import org.apache.wicket.version.undo.Change;
@@ -101,6 +102,19 @@
                return null;
        }
 
+       public Form getForm()
+       {
+               try
+               {
+                       return super.getForm();
+               }
+               catch (WicketRuntimeException wre)
+               {
+                       // ignore this and return null. 
(Form.findSubmittingComponent expects this)
+               }
+               return null;
+       }
+
        /**
         * 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
@@ -142,7 +156,7 @@
                                public String toString()
                                {
                                        return 
"DefaultFormProcessingChange[component: " + getPath() +
-                                                       ", default processing: 
" + formerValue + "]";
+                                               ", default processing: " + 
formerValue + "]";
                                }
                        });
                }


Reply via email to