You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@wicket.apache.org by iv...@apache.org on 2007/09/23 18:19:30 UTC

svn commit: r578578 - /wicket/trunk/jdk-1.4/wicket/src/main/java/org/apache/wicket/ajax/markup/html/form/AjaxButton.java

Author: ivaynberg
Date: Sun Sep 23 09:19:26 2007
New Revision: 578578

URL: http://svn.apache.org/viewvc?rev=578578&view=rev
Log:
WICKET-997: AjaxButton using null as the form in the onSubmit() callback

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

Modified: wicket/trunk/jdk-1.4/wicket/src/main/java/org/apache/wicket/ajax/markup/html/form/AjaxButton.java
URL: http://svn.apache.org/viewvc/wicket/trunk/jdk-1.4/wicket/src/main/java/org/apache/wicket/ajax/markup/html/form/AjaxButton.java?rev=578578&r1=578577&r2=578578&view=diff
==============================================================================
--- wicket/trunk/jdk-1.4/wicket/src/main/java/org/apache/wicket/ajax/markup/html/form/AjaxButton.java (original)
+++ wicket/trunk/jdk-1.4/wicket/src/main/java/org/apache/wicket/ajax/markup/html/form/AjaxButton.java Sun Sep 23 09:19:26 2007
@@ -24,9 +24,8 @@
 import org.apache.wicket.util.string.AppendingStringBuffer;
 
 /**
- * A button that submits the form via ajax. Since this button takes the form as
- * a constructor argument it does not need to be added to it unlike the
- * {@link Button} component.
+ * A button that submits the form via ajax. Since this button takes the form as a constructor
+ * argument it does not need to be added to it unlike the {@link Button} component.
  * 
  * @since 1.3
  * 
@@ -37,7 +36,7 @@
 	private static final long serialVersionUID = 1L;
 
 	private final Form form;
-	
+
 	/**
 	 * Construct.
 	 * 
@@ -47,10 +46,11 @@
 	{
 		this(id, null);
 	}
-	
+
 	/**
-	 * Returns the form if it was set in constructor, otherwise returns the 
-	 * form nearest in parent hierarchy.
+	 * Returns the form if it was set in constructor, otherwise returns the form nearest in parent
+	 * hierarchy.
+	 * 
 	 * @see org.apache.wicket.markup.html.form.FormComponent#getForm()
 	 */
 	public Form getForm()
@@ -83,12 +83,12 @@
 
 			protected void onSubmit(AjaxRequestTarget target)
 			{
-				AjaxButton.this.onSubmit(target, form);
+				AjaxButton.this.onSubmit(target, AjaxButton.this.getForm());
 			}
 
 			protected void onError(AjaxRequestTarget target)
 			{
-				AjaxButton.this.onError(target, form);
+				AjaxButton.this.onError(target, AjaxButton.this.getForm());
 			}
 
 			protected CharSequence getEventHandler()
@@ -106,12 +106,10 @@
 	}
 
 	/**
-	 * Returns the {@link IAjaxCallDecorator} that will be used to modify the
-	 * generated javascript. This is the preferred way of changing the
-	 * javascript in the onclick handler
+	 * Returns the {@link IAjaxCallDecorator} that will be used to modify the generated javascript.
+	 * This is the preferred way of changing the javascript in the onclick handler
 	 * 
-	 * @return call decorator used to modify the generated javascript or null
-	 *         for none
+	 * @return call decorator used to modify the generated javascript or null for none
 	 */
 	protected IAjaxCallDecorator getAjaxCallDecorator()
 	{