summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorwei <>2006-05-05 08:20:50 +0000
committerwei <>2006-05-05 08:20:50 +0000
commit4d70cc125dcd915cdbc8c4f13964d27ebec96eca (patch)
tree3ebd35be9ed02e97a08196817ee330131cf938b4 /tests
parent47d05516b1d1c465217c59732bf8442ab0cfd497 (diff)
Update funky active control example. (see tests/FunctionalTests/features/
Diffstat (limited to 'tests')
-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)];
}
}
?>