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/09/19 23:10:11 UTC

svn commit: r816954 - /wicket/branches/wicket-1.4.x/wicket/src/main/java/org/apache/wicket/markup/html/form/Form.java

Author: jdonnerstag
Date: Sat Sep 19 21:10:11 2009
New Revision: 816954

URL: http://svn.apache.org/viewvc?rev=816954&view=rev
Log:
fixed: Form.findForm(Component c) bug. When form is part of Border and form component like TextField is inside another Border , component cannot resolve its form.
Issue: WICKET-2453

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

Modified: wicket/branches/wicket-1.4.x/wicket/src/main/java/org/apache/wicket/markup/html/form/Form.java
URL: http://svn.apache.org/viewvc/wicket/branches/wicket-1.4.x/wicket/src/main/java/org/apache/wicket/markup/html/form/Form.java?rev=816954&r1=816953&r2=816954&view=diff
==============================================================================
--- wicket/branches/wicket-1.4.x/wicket/src/main/java/org/apache/wicket/markup/html/form/Form.java (original)
+++ wicket/branches/wicket-1.4.x/wicket/src/main/java/org/apache/wicket/markup/html/form/Form.java Sat Sep 19 21:10:11 2009
@@ -2311,12 +2311,16 @@
 		if (form == null)
 		{
 			// check whether the form is a child of a surrounding border
-			final Border border = component.findParent(Border.class);
-			if (border != null)
+			Border border = component.findParent(Border.class);
+			while ((form == null) && (border != null))
 			{
 				FindFormVisitor formVisitor = new FindFormVisitor();
 				border.visitChildren(Form.class, formVisitor);
 				form = formVisitor.form;
+				if (form == null)
+				{
+					border = border.findParent(Border.class);
+				}
 			}
 		}
 		return form;