You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@wicket.apache.org by jd...@apache.org on 2009/01/13 21:49:57 UTC

svn commit: r734239 - /wicket/trunk/wicket/src/main/java/org/apache/wicket/util/tester/FormTester.java

Author: jdonnerstag
Date: Tue Jan 13 12:49:46 2009
New Revision: 734239

URL: http://svn.apache.org/viewvc?rev=734239&view=rev
Log:
fixed wicket-2019: Validation messages aren't cleared on success

form.submit() will now reset the feedback messages

Modified:
    wicket/trunk/wicket/src/main/java/org/apache/wicket/util/tester/FormTester.java

Modified: wicket/trunk/wicket/src/main/java/org/apache/wicket/util/tester/FormTester.java
URL: http://svn.apache.org/viewvc/wicket/trunk/wicket/src/main/java/org/apache/wicket/util/tester/FormTester.java?rev=734239&r1=734238&r2=734239&view=diff
==============================================================================
--- wicket/trunk/wicket/src/main/java/org/apache/wicket/util/tester/FormTester.java (original)
+++ wicket/trunk/wicket/src/main/java/org/apache/wicket/util/tester/FormTester.java Tue Jan 13 12:49:46 2009
@@ -27,8 +27,8 @@
 import java.util.Map;
 
 import org.apache.wicket.Component;
-import org.apache.wicket.Component.IVisitor;
 import org.apache.wicket.WicketRuntimeException;
+import org.apache.wicket.Component.IVisitor;
 import org.apache.wicket.markup.html.form.AbstractTextComponent;
 import org.apache.wicket.markup.html.form.Check;
 import org.apache.wicket.markup.html.form.CheckBox;
@@ -491,11 +491,11 @@
 
 	/**
 	 * Simulates selecting an option of a <code>FormComponent</code>. Supports
-	 * <code>RadioGroup</code>, <code>CheckGroup</code>, and <code>AbstractChoice</code>
-	 * family currently. The behavior is similar to interacting on the browser: For a single choice,
-	 * such as <code>Radio</code> or <code>DropDownList</code>, the selection will toggle each
-	 * other. For multiple choice, such as <code>Checkbox</code> or
-	 * <code>ListMultipleChoice</code>, the selection will accumulate.
+	 * <code>RadioGroup</code>, <code>CheckGroup</code>, and <code>AbstractChoice</code> family
+	 * currently. The behavior is similar to interacting on the browser: For a single choice, such
+	 * as <code>Radio</code> or <code>DropDownList</code>, the selection will toggle each other. For
+	 * multiple choice, such as <code>Checkbox</code> or <code>ListMultipleChoice</code>, the
+	 * selection will accumulate.
 	 * 
 	 * @param formComponentId
 	 *            relative path (from <code>Form</code>) to the selectable
@@ -514,11 +514,9 @@
 		{
 			try
 			{
-				Method wantOnSelectionChangedNotificationsMethod = DropDownChoice.class.getDeclaredMethod(
-					"wantOnSelectionChangedNotifications");
+				Method wantOnSelectionChangedNotificationsMethod = DropDownChoice.class.getDeclaredMethod("wantOnSelectionChangedNotifications");
 				wantOnSelectionChangedNotificationsMethod.setAccessible(true);
-				boolean wantOnSelectionChangedNotifications = (Boolean) wantOnSelectionChangedNotificationsMethod.invoke(
-						component);
+				boolean wantOnSelectionChangedNotifications = (Boolean)wantOnSelectionChangedNotificationsMethod.invoke(component);
 				if (wantOnSelectionChangedNotifications)
 				{
 					((DropDownChoice<?>)component).onSelectionChanged();
@@ -621,6 +619,8 @@
 		checkClosed();
 		try
 		{
+			baseWicketTester.getWicketSession().cleanupFeedbackMessages();
+
 			MockHttpServletRequest servletRequest = baseWicketTester.getServletRequest();
 
 			WebRequestCycle requestCycle = baseWicketTester.createRequestCycle();
@@ -678,8 +678,8 @@
 	}
 
 	/**
-	 * Adds an additional <code>FormComponent</code>'s value into request parameter -- this
-	 * method retains existing parameters but removes any duplicate parameters.
+	 * Adds an additional <code>FormComponent</code>'s value into request parameter -- this method
+	 * retains existing parameters but removes any duplicate parameters.
 	 * 
 	 * @param formComponent
 	 *            a <code>FormComponent</code>