summaryrefslogtreecommitdiff
path: root/tests/FunctionalTests
diff options
context:
space:
mode:
Diffstat (limited to 'tests/FunctionalTests')
-rw-r--r--tests/FunctionalTests/features/protected/pages/ActiveControls/ActiveControl.page22
-rw-r--r--tests/FunctionalTests/features/protected/pages/ActiveControls/ActiveControl.php26
2 files changed, 38 insertions, 10 deletions
diff --git a/tests/FunctionalTests/features/protected/pages/ActiveControls/ActiveControl.page b/tests/FunctionalTests/features/protected/pages/ActiveControls/ActiveControl.page
index b33e9000..c98bae4d 100644
--- a/tests/FunctionalTests/features/protected/pages/ActiveControls/ActiveControl.page
+++ b/tests/FunctionalTests/features/protected/pages/ActiveControls/ActiveControl.page
@@ -3,21 +3,27 @@
<com:TClientScript UsingPradoScripts="ajax" />
<com:TCallback id="control1"
ClientSide.EnablePageStateUpdate="false"
- OnCallback="control1onCallback" />
+ OnCallback="slowResponse" />
<com:TCallback id="control2"
ClientSide.HasPriority="false"
- OnCallback="control1onCallback" />
+ OnCallback="fastResponse" />
- <com:TActiveLabel id="label1" Text="Name:" />
+ <com:TActiveLabel id="label1" Text="Name:" AllowCallbackUpdate="false" />
<com:TTextBox id="text1" />
+ <com:TActiveLabel id="label2" />
- <com:TCheckBoxList>
- <com:TListItem Text="One" />
- <com:TListItem Text="Two" />
- </com:TCheckBoxList>
+ <com:TActivePanel id="panel1" >
+ <com:TPanel id="panel2" Visible="false">
+ <com:TCheckBoxList>
+ <com:TListItem Text="One" />
+ <com:TListItem Text="Two" />
+ </com:TCheckBoxList>
+ </com:TPanel>
+ </com:TActivePanel>
+
- <com:TButton id="button1" Text="Submit 1" CausesValidation="false" />
+ <com:TButton id="button1" Text="Submit 1 (3s delay)" CausesValidation="false" />
<com:TButton id="button2" Text="Submit 2" CausesValidation="false" />
<script>
Event.observe("<%= $this->button1->ClientID %>", "click", function(event)
diff --git a/tests/FunctionalTests/features/protected/pages/ActiveControls/ActiveControl.php b/tests/FunctionalTests/features/protected/pages/ActiveControls/ActiveControl.php
index e9a6226a..ace6291b 100644
--- a/tests/FunctionalTests/features/protected/pages/ActiveControls/ActiveControl.php
+++ b/tests/FunctionalTests/features/protected/pages/ActiveControls/ActiveControl.php
@@ -5,10 +5,32 @@
class ActiveControl extends TPage
{
- public function control1onCallback($sender, $param)
+ static private $_colors = array('red', 'green', 'blue', 'purple','black','orange');
+
+ public function slowResponse($sender, $param)
{
- sleep(5);
+ sleep(3);
$this->label1->setText("The time is ".time()." from ".$sender->ID);
+ $this->label1->setForeColor($this->getColor());
+ $this->label1->renderControl($param->getOutput());
+
+ $this->panel2->setVisible(true);
+ $this->panel1->setBackColor($this->getColor());
+ $this->panel1->renderControl($param->getOutput());
+ $this->getCallbackClient()->shake($this->panel1);
+ }
+
+ public function fastResponse($sender, $param)
+ {
+ $this->label2->setText("Muahaha !!! the time is ".time()." from ".$sender->ID);
+ $style['color'] = $this->getColor();
+ $this->getCallbackClient()->setStyle($this->label2, $style);
+ $this->getCallbackClient()->shake($this->label2);
+ }
+
+ private function getColor()
+ {
+ return self::$_colors[rand(0,count(self::$_colors)-1)];
}
}
?>