You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@myfaces.apache.org by gm...@apache.org on 2007/09/04 16:39:25 UTC

svn commit: r572691 - /myfaces/tomahawk/trunk/sandbox/core/src/main/resources/org/apache/myfaces/custom/ppr/resource/ppr.js

Author: gmuellan
Date: Tue Sep  4 07:39:24 2007
New Revision: 572691

URL: http://svn.apache.org/viewvc?rev=572691&view=rev
Log:
periodical update should not occur immediately after the response, but after the given timeout

Modified:
    myfaces/tomahawk/trunk/sandbox/core/src/main/resources/org/apache/myfaces/custom/ppr/resource/ppr.js

Modified: myfaces/tomahawk/trunk/sandbox/core/src/main/resources/org/apache/myfaces/custom/ppr/resource/ppr.js
URL: http://svn.apache.org/viewvc/myfaces/tomahawk/trunk/sandbox/core/src/main/resources/org/apache/myfaces/custom/ppr/resource/ppr.js?rev=572691&r1=572690&r2=572691&view=diff
==============================================================================
--- myfaces/tomahawk/trunk/sandbox/core/src/main/resources/org/apache/myfaces/custom/ppr/resource/ppr.js (original)
+++ myfaces/tomahawk/trunk/sandbox/core/src/main/resources/org/apache/myfaces/custom/ppr/resource/ppr.js Tue Sep  4 07:39:24 2007
@@ -157,6 +157,14 @@
 
 org.apache.myfaces.PPRCtrl.prototype.startPeriodicalUpdate = function(refreshTimeout, refreshZoneId)
 {
+    var ppr = this;
+    setTimeout(function(){ppr.doPeriodicalUpdate(refreshTimeout, refreshZoneId)}, refreshTimeout);
+};
+
+// periodically called when updating automatically 
+
+org.apache.myfaces.PPRCtrl.prototype.doPeriodicalUpdate = function(refreshTimeout, refreshZoneId)
+{
     var content = new Array;
     content["org.apache.myfaces.PPRCtrl.triggeredComponents"] = refreshZoneId;
     this.doAjaxSubmit(content, refreshTimeout, refreshZoneId, null);
@@ -327,7 +335,7 @@
     if(refreshTimeout && !this.blockPeriodicalUpdateDuringPost)
     {
         window.setTimeout(function() {
-            ppr.startPeriodicalUpdate(refreshTimeout, refreshZoneId);
+            ppr.doPeriodicalUpdate(refreshTimeout, refreshZoneId);
         }, refreshTimeout)
     }
 };
@@ -526,7 +534,7 @@
             var zoneId = zones[i];
             var timeout = window.oamRefreshTimeoutForZoneId[zoneId];
             if (!timeout) return false;
-            this.startPeriodicalUpdate(timeout, zoneId);
+            this.doPeriodicalUpdate(timeout, zoneId);
             event.target.oam_periodicalStarted = true;
         }
     }