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 2008/10/02 18:59:58 UTC

svn commit: r701189 - /wicket/trunk/wicket/src/main/java/org/apache/wicket/markup/html/form/Form.java

Author: ivaynberg
Date: Thu Oct  2 09:59:57 2008
New Revision: 701189

URL: http://svn.apache.org/viewvc?rev=701189&view=rev
Log:
a better way to override process()

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

Modified: wicket/trunk/wicket/src/main/java/org/apache/wicket/markup/html/form/Form.java
URL: http://svn.apache.org/viewvc/wicket/trunk/wicket/src/main/java/org/apache/wicket/markup/html/form/Form.java?rev=701189&r1=701188&r2=701189&view=diff
==============================================================================
--- wicket/trunk/wicket/src/main/java/org/apache/wicket/markup/html/form/Form.java (original)
+++ wicket/trunk/wicket/src/main/java/org/apache/wicket/markup/html/form/Form.java Thu Oct  2 09:59:57 2008
@@ -868,12 +868,9 @@
 					{
 						formToProcess = submittingComponent.getForm();
 					}
+
 					// process the form for this request
-					if (formToProcess.process())
-					{
-						// let clients handle further processing
-						delegateSubmit(submittingComponent);
-					}
+					process(submittingComponent);
 				}
 			}
 		}
@@ -885,6 +882,33 @@
 		}
 	}
 
+
+	/**
+	 * Process the form. Though you can override this method to provide your own algorithm, it is
+	 * not recommended to do so.
+	 * 
+	 * <p>
+	 * See the class documentation for further details on the form processing
+	 * </p>
+	 * 
+	 * @param submittingComponent
+	 *            component responsible for submitting the form, or <code>null</code> if none (eg
+	 *            the form has been submitted via the enter key or javascript calling
+	 *            form.onsubmit())
+	 * 
+	 * @see #delegateSubmit(IFormSubmittingComponent) for an easy way to process submitting
+	 *      component in the default manner
+	 */
+	public void process(IFormSubmittingComponent submittingComponent)
+	{
+		// process the form for this request
+		if (process())
+		{
+			// let clients handle further processing
+			delegateSubmit(submittingComponent);
+		}
+	}
+
 	/**
 	 * Process the form. Though you can override this method to provide your whole own algorithm, it
 	 * is not recommended to do so.
@@ -892,8 +916,11 @@
 	 * See the class documentation for further details on the form processing
 	 * </p>
 	 * 
+	 * @deprecated use {@link #process(IFormSubmittingComponent)}
+	 * 
 	 * @return False if the form had an error
 	 */
+	@Deprecated
 	public boolean process()
 	{
 		if (!isEnabled() || !isEnableAllowed() || !isVisibleInHierarchy())