summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorwei <>2007-05-09 04:21:41 +0000
committerwei <>2007-05-09 04:21:41 +0000
commitc3c0dc28d3e9964bddbe66dac34080cf9e1dd05c (patch)
tree648bb85a309712e66374dc4dac25cbea839a328b
parent2c8dcb09949ea6fb1ae9ee45cc1b36a0d5c396d9 (diff)
Fixed #598
-rw-r--r--.gitattributes4
-rw-r--r--framework/Web/Javascripts/source/prado/activecontrols/activecontrols3.js6
-rw-r--r--framework/Web/Javascripts/source/prado/activecontrols/ajax3.js10
-rw-r--r--tests/FunctionalTests/tickets/protected/pages/Ticket598.page17
-rw-r--r--tests/FunctionalTests/tickets/protected/pages/Ticket598.php19
-rw-r--r--tests/FunctionalTests/tickets/protected/pages/Ticket603.page9
-rw-r--r--tests/FunctionalTests/tickets/protected/pages/Ticket603.php30
7 files changed, 88 insertions, 7 deletions
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 @@
+<com:TContent ID="Content">
+
+Time : <com:TActiveLabel id="Lbl"/><br/>
+
+<com:TActiveButton OnCallback="startBigTask" Text="Start Big Task" ClientSide.HasPriority="false">
+ <prop:ClientSide.OnLoading>
+ Prado.WebUI.TTimeTriggeredCallback.start('<%= $this->Timer->ClientID %>')
+ </prop:ClientSide.OnLoading>
+ <prop:ClientSide.OnComplete>
+ Prado.WebUI.TTimeTriggeredCallback.stop('<%= $this->Timer->ClientID %>')
+ </prop:ClientSide.OnComplete>
+</com:TActiveButton>
+
+<com:TTimeTriggeredCallback Id="Timer" Interval="0.5" OnCallback="updateLbl" StartTimerOnLoad="false"/>
+
+
+</com:TContent> \ 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 @@
+<?php
+Prado::using('System.Web.UI.ActiveControls.*');
+class Ticket598 extends TPage
+{
+public function onLoad ($param) {
+ parent::onLoad($param);
+ if (!$this->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 @@
+<com:TContent ID="Content">
+
+<com:TActiveButton ID="switchContentTypeButton"
+ Text="change" onClick="switchContentTypeClicked" onCallBack="switchContentTypeCallback" />
+<com:TActivePanel ID="ContentPanel" >
+ <com:THtmlArea ID="EditHtmlTextBox" />
+</com:TActivePanel>
+
+</com:TContent> \ 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 @@
+<?php
+
+Prado::using('System.Web.UI.ActiveControls.*');
+
+class Ticket603 extends TPage
+{
+ protected $_isHtml;
+
+ public function onLoad($param) {
+ parent::onLoad($param);
+ $this->_isHtml = true;
+ }
+
+ public function switchContentTypeClicked( $sender, $param ) {
+ $this->_isHtml = !$this->_isHtml;
+ if ( $this->_isHtml ) {
+ $this->EditHtmlTextBox->EnableVisualEdit = true;
+ $this->EditHtmlTextBox->Text = '<b>somehtml</b>';
+ } 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