From c3c0dc28d3e9964bddbe66dac34080cf9e1dd05c Mon Sep 17 00:00:00 2001 From: wei <> Date: Wed, 9 May 2007 04:21:41 +0000 Subject: Fixed #598 --- .../Javascripts/source/prado/activecontrols/activecontrols3.js | 6 ++++-- framework/Web/Javascripts/source/prado/activecontrols/ajax3.js | 10 +++++----- 2 files changed, 9 insertions(+), 7 deletions(-) (limited to 'framework') diff --git a/framework/Web/Javascripts/source/prado/activecontrols/activecontrols3.js b/framework/Web/Javascripts/source/prado/activecontrols/activecontrols3.js index 444f3ab2..28bd3fa9 100644 --- a/framework/Web/Javascripts/source/prado/activecontrols/activecontrols3.js +++ b/framework/Web/Javascripts/source/prado/activecontrols/activecontrols3.js @@ -213,12 +213,14 @@ Prado.WebUI.TTimeTriggeredCallback = Base.extend( start : function(id) { - Prado.WebUI.TTimeTriggeredCallback.timers[id].startTimer(); + if(Prado.WebUI.TTimeTriggeredCallback.timers[id]) + Prado.WebUI.TTimeTriggeredCallback.timers[id].startTimer(); }, stop : function(id) { - Prado.WebUI.TTimeTriggeredCallback.timers[id].stopTimer(); + if(Prado.WebUI.TTimeTriggeredCallback.timers[id]) + Prado.WebUI.TTimeTriggeredCallback.timers[id].stopTimer(); } }); diff --git a/framework/Web/Javascripts/source/prado/activecontrols/ajax3.js b/framework/Web/Javascripts/source/prado/activecontrols/ajax3.js index 27537e8b..ccd8df12 100644 --- a/framework/Web/Javascripts/source/prado/activecontrols/ajax3.js +++ b/framework/Web/Javascripts/source/prado/activecontrols/ajax3.js @@ -319,8 +319,7 @@ Object.extend(Prado.CallbackRequest, */ dispatchNormalRequest : function(callback) { - //Logger.info("dispatching normal request"); - //new Prado.AjaxRequest(callback); + callback.options.postBody = callback._getPostData(), callback.request(callback.url); return true; }, @@ -352,7 +351,7 @@ Object.extend(Prado.CallbackRequest, var self = Prado.CallbackRequest; var pagestate = $(self.FIELD_CALLBACK_PAGESTATE); var enabled = request.ActiveControl.EnablePageStateUpdate && request.ActiveControl.HasPriority; - var aborted = self.currentRequest == null; + var aborted = typeof(self.currentRequest) == 'undefined' || self.currentRequest == null; if(enabled && !aborted && pagestate) { var data = request.getBodyContentPart(self.PAGESTATE_HEADER); @@ -393,19 +392,20 @@ Object.extend(Prado.CallbackRequest, callback.options.postBody = callback._getPostData(), //callback.request = new Prado.AjaxRequest(callback); - callback.request(callback.url); callback.timeout = setTimeout(function() { //Logger.warn("priority timeout"); self.abortRequest(callback.id); },callback.ActiveControl.RequestTimeOut); + callback.request(callback.url); //Logger.debug("dispatched "+self.currentRequest.id + " ...") }, endCurrentRequest : function() { var self = Prado.CallbackRequest; - clearTimeout(self.currentRequest.timeout); + if(typeof(self.currentRequest) != 'undefined' && self.currentRequest != null) + clearTimeout(self.currentRequest.timeout); self.currentRequest=null; }, -- cgit v1.2.3