Author: ivaynberg
Date: Thu Apr 19 15:20:09 2007
New Revision: 530572

URL: http://svn.apache.org/viewvc?view=rev&rev=530572
Log:
throw an error when users add a listview, or other repeaters, to the ajax 
request target. hopefully no more "why my listview doesnt update via ajax" 
questions.

Modified:
    
incubator/wicket/trunk/jdk-1.4/wicket/src/main/java/org/apache/wicket/ajax/AjaxRequestTarget.java

Modified: 
incubator/wicket/trunk/jdk-1.4/wicket/src/main/java/org/apache/wicket/ajax/AjaxRequestTarget.java
URL: 
http://svn.apache.org/viewvc/incubator/wicket/trunk/jdk-1.4/wicket/src/main/java/org/apache/wicket/ajax/AjaxRequestTarget.java?view=diff&rev=530572&r1=530571&r2=530572
==============================================================================
--- 
incubator/wicket/trunk/jdk-1.4/wicket/src/main/java/org/apache/wicket/ajax/AjaxRequestTarget.java
 (original)
+++ 
incubator/wicket/trunk/jdk-1.4/wicket/src/main/java/org/apache/wicket/ajax/AjaxRequestTarget.java
 Thu Apr 19 15:20:09 2007
@@ -44,6 +44,7 @@
 import org.apache.wicket.markup.html.internal.HeaderResponse;
 import org.apache.wicket.markup.html.internal.HtmlHeaderContainer;
 import org.apache.wicket.markup.parser.filter.HtmlHeaderSectionHandler;
+import org.apache.wicket.markup.repeater.AbstractRepeater;
 import org.apache.wicket.protocol.http.WebResponse;
 import org.apache.wicket.util.string.AppendingStringBuffer;
 import org.apache.wicket.util.string.Strings;
@@ -304,8 +305,8 @@
                                        "Argument `childCriteria` cannot be 
null. If you want to traverse all components use `"
                                                        + 
Component.class.getName() + ".class` as the value for this argument");
                }
-               
-               
+
+
                parent.visitChildren(childCriteria, new Component.IVisitor()
                {
 
@@ -361,6 +362,13 @@
                else if (component instanceof Page)
                {
                        throw new IllegalArgumentException("component cannot be 
a page");
+               }
+               else if (component instanceof AbstractRepeater)
+               {
+                       throw new IllegalArgumentException(
+                                       "Component "
+                                                       + 
component.getClass().getName()
+                                                       + " has been added to 
the target. This component is a repeater and cannot be repainted via ajax 
directly. Instead add its parent or another markup container higher in the 
hieararchy.");
                }
 
                markupIdToComponent.put(markupId, component);


Reply via email to