From c3c0dc28d3e9964bddbe66dac34080cf9e1dd05c Mon Sep 17 00:00:00 2001 From: wei <> Date: Wed, 9 May 2007 04:21:41 +0000 Subject: Fixed #598 --- .gitattributes | 4 +++ .../source/prado/activecontrols/activecontrols3.js | 6 +++-- .../source/prado/activecontrols/ajax3.js | 10 ++++---- .../tickets/protected/pages/Ticket598.page | 17 ++++++++++++ .../tickets/protected/pages/Ticket598.php | 19 ++++++++++++++ .../tickets/protected/pages/Ticket603.page | 9 +++++++ .../tickets/protected/pages/Ticket603.php | 30 ++++++++++++++++++++++ 7 files changed, 88 insertions(+), 7 deletions(-) create mode 100644 tests/FunctionalTests/tickets/protected/pages/Ticket598.page create mode 100644 tests/FunctionalTests/tickets/protected/pages/Ticket598.php create mode 100644 tests/FunctionalTests/tickets/protected/pages/Ticket603.page create mode 100644 tests/FunctionalTests/tickets/protected/pages/Ticket603.php diff --git a/.gitattributes b/.gitattributes index 8a52fca2..38ae357b 100644 --- a/.gitattributes +++ b/.gitattributes @@ -2572,6 +2572,10 @@ tests/FunctionalTests/tickets/protected/pages/Ticket587_reopened.php -text tests/FunctionalTests/tickets/protected/pages/Ticket591.page -text tests/FunctionalTests/tickets/protected/pages/Ticket591.php -text tests/FunctionalTests/tickets/protected/pages/Ticket593.page -text +tests/FunctionalTests/tickets/protected/pages/Ticket598.page -text +tests/FunctionalTests/tickets/protected/pages/Ticket598.php -text +tests/FunctionalTests/tickets/protected/pages/Ticket603.page -text +tests/FunctionalTests/tickets/protected/pages/Ticket603.php -text tests/FunctionalTests/tickets/protected/pages/Ticket605.page -text tests/FunctionalTests/tickets/protected/pages/Ticket606.page -text tests/FunctionalTests/tickets/protected/pages/Ticket609.page -text 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; }, diff --git a/tests/FunctionalTests/tickets/protected/pages/Ticket598.page b/tests/FunctionalTests/tickets/protected/pages/Ticket598.page new file mode 100644 index 00000000..7d618ff1 --- /dev/null +++ b/tests/FunctionalTests/tickets/protected/pages/Ticket598.page @@ -0,0 +1,17 @@ + + +Time :
+ + + + Prado.WebUI.TTimeTriggeredCallback.start('<%= $this->Timer->ClientID %>') + + + Prado.WebUI.TTimeTriggeredCallback.stop('<%= $this->Timer->ClientID %>') + + + + + + +
\ No newline at end of file diff --git a/tests/FunctionalTests/tickets/protected/pages/Ticket598.php b/tests/FunctionalTests/tickets/protected/pages/Ticket598.php new file mode 100644 index 00000000..0456725f --- /dev/null +++ b/tests/FunctionalTests/tickets/protected/pages/Ticket598.php @@ -0,0 +1,19 @@ +isPostBack and !$this->isCallBack) { + $this->Lbl->setText(date("h:m:s")); + } + } + public function startBigTask ($sender, $param) { + sleep(10); // Simulate task + } + + public function updateLbl($sender, $param) { + $this->Lbl->SetText(date("h:m:s")); + } +} +?> \ No newline at end of file diff --git a/tests/FunctionalTests/tickets/protected/pages/Ticket603.page b/tests/FunctionalTests/tickets/protected/pages/Ticket603.page new file mode 100644 index 00000000..d5023adc --- /dev/null +++ b/tests/FunctionalTests/tickets/protected/pages/Ticket603.page @@ -0,0 +1,9 @@ + + + + + + + + \ No newline at end of file diff --git a/tests/FunctionalTests/tickets/protected/pages/Ticket603.php b/tests/FunctionalTests/tickets/protected/pages/Ticket603.php new file mode 100644 index 00000000..6af0cf6d --- /dev/null +++ b/tests/FunctionalTests/tickets/protected/pages/Ticket603.php @@ -0,0 +1,30 @@ +_isHtml = true; + } + + public function switchContentTypeClicked( $sender, $param ) { + $this->_isHtml = !$this->_isHtml; + if ( $this->_isHtml ) { + $this->EditHtmlTextBox->EnableVisualEdit = true; + $this->EditHtmlTextBox->Text = 'somehtml'; + } else { + $this->EditHtmlTextBox->EnableVisualEdit = false; + $this->EditHtmlTextBox->Text = 'plai bla bla'; + } + } + + public function switchContentTypeCallback( $sender, $param ) { + $this->ContentPanel->render( $param->NewWriter ); + } +} + +?> \ No newline at end of file -- cgit v1.2.3