Author: jcompagner
Date: Mon Jun  4 04:42:45 2007
New Revision: 544127

URL: http://svn.apache.org/viewvc?view=rev&rev=544127
Log:
test if the component is not a page.
Because if it is a page then the precondition isn't set.

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

Modified: 
incubator/wicket/trunk/jdk-1.4/wicket/src/main/java/org/apache/wicket/ajax/AbstractAjaxTimerBehavior.java
URL: 
http://svn.apache.org/viewvc/incubator/wicket/trunk/jdk-1.4/wicket/src/main/java/org/apache/wicket/ajax/AbstractAjaxTimerBehavior.java?view=diff&rev=544127&r1=544126&r2=544127
==============================================================================
--- 
incubator/wicket/trunk/jdk-1.4/wicket/src/main/java/org/apache/wicket/ajax/AbstractAjaxTimerBehavior.java
 (original)
+++ 
incubator/wicket/trunk/jdk-1.4/wicket/src/main/java/org/apache/wicket/ajax/AbstractAjaxTimerBehavior.java
 Mon Jun  4 04:42:45 2007
@@ -16,6 +16,7 @@
  */
 package org.apache.wicket.ajax;
 
+import org.apache.wicket.Page;
 import org.apache.wicket.markup.html.IHeaderResponse;
 import org.apache.wicket.util.time.Duration;
 
@@ -80,8 +81,13 @@
 
        protected CharSequence getCallbackScript()
        {
-               String componentId = getComponent().getMarkupId();
-               String precondition = "var c = Wicket.$('" + componentId + "'); 
return typeof(c) != 'undefined' && c != null";
+               String precondition = null;
+               
+               if ( !(getComponent() instanceof Page) )
+               {
+                       String componentId = getComponent().getMarkupId();
+                       precondition = "var c = Wicket.$('" + componentId + 
"'); return typeof(c) != 'undefined' && c != null";
+               }
                
                return getCallbackScript("wicketAjaxGet('"
                                + getCallbackUrl(onlyTargetActivePage()) + "'", 
null, null, precondition);


Reply via email to