summaryrefslogtreecommitdiff
path: root/tests/FunctionalTests
diff options
context:
space:
mode:
authorwei <>2007-03-30 08:49:15 +0000
committerwei <>2007-03-30 08:49:15 +0000
commit9db5f1ef950e571d19cc70f1b22da1d77f22448b (patch)
treed46d16e555e5249a47e637e273494c8f0291422d /tests/FunctionalTests
parent429e20f85c5d1f633fa64bacfc4b8b2426147487 (diff)
Fixed #504
Diffstat (limited to 'tests/FunctionalTests')
-rw-r--r--tests/FunctionalTests/tickets/protected/pages/Ticket504.page67
-rw-r--r--tests/FunctionalTests/tickets/protected/pages/Ticket504.php27
2 files changed, 94 insertions, 0 deletions
diff --git a/tests/FunctionalTests/tickets/protected/pages/Ticket504.page b/tests/FunctionalTests/tickets/protected/pages/Ticket504.page
new file mode 100644
index 00000000..0242dd97
--- /dev/null
+++ b/tests/FunctionalTests/tickets/protected/pages/Ticket504.page
@@ -0,0 +1,67 @@
+<com:TContent ID="Content">
+
+<com:TCallback ID="loadData" OnCallback="loadData_Callback"/>
+
+<div style="height:1em">
+<div id="loading" style="display:none"> loading...</div>
+</div>
+<div id="status"></div>
+
+<com:TCallbackOptions ID="LoadDataOptions">
+ <prop:ClientSide.OnSuccess>
+ $('status').innerHTML = sender.ActiveControl.CallbackParameter + " updated";
+ </prop:ClientSide.OnSuccess>
+
+ <prop:ClientSide.OnLoading>
+ $('loading').show();
+ </prop:ClientSide.OnLoading>
+
+ <prop:ClientSide.OnComplete>
+ $('loading').hide();
+ </prop:ClientSide.OnComplete>
+</com:TCallbackOptions>
+
+
+
+<com:TActiveLinkButton
+ Text="Tab A"
+ OnCallback="changePanel"
+ ActiveControl.CallbackOptions="LoadDataOptions"
+ ActiveControl.CallbackParameter="panelA"
+ />
+<com:TActiveLinkButton
+ Text="Tab B"
+ OnCallback="changePanel"
+ ActiveControl.CallbackOptions="LoadDataOptions"
+ ActiveControl.CallbackParameter="panelB"
+ />
+<com:TActiveLinkButton
+ Text="Tab C"
+ OnCallback="changePanel"
+ ActiveControl.CallbackOptions="LoadDataOptions"
+ ActiveControl.CallbackParameter="panelC"
+ />
+<com:TActiveLinkButton
+ Text="Tab D"
+ OnCallback="changePanel"
+ ActiveControl.CallbackOptions="LoadDataOptions"
+ ActiveControl.CallbackParameter="panelD"
+ />
+
+<com:TActivePanel ID="panelA">
+ <h1>Panel A</h1>
+</com:TActivePanel>
+
+<com:TActivePanel ID="panelB">
+ <h1>Panel B</h1>
+</com:TActivePanel>
+
+<com:TActivePanel ID="panelC">
+ <h1>Panel C</h1>
+</com:TActivePanel>
+
+<com:TActivePanel ID="panelD">
+ <h1>Panel D</h1>
+</com:TActivePanel>
+
+</com:TContent> \ No newline at end of file
diff --git a/tests/FunctionalTests/tickets/protected/pages/Ticket504.php b/tests/FunctionalTests/tickets/protected/pages/Ticket504.php
new file mode 100644
index 00000000..f61bfec3
--- /dev/null
+++ b/tests/FunctionalTests/tickets/protected/pages/Ticket504.php
@@ -0,0 +1,27 @@
+<?php
+
+Prado::using('System.Web.UI.ActiveControls.*');
+
+class Ticket504 extends TPage
+{
+ private $panels = array('panelA', 'panelB', 'panelC','panelD',);
+ private function showPanel($id, $param) {
+ foreach($this->panels as $panel) {
+ if($id == $panel) {
+ $this->$panel->setAttribute('style', 'display: block;');
+ $this->$panel->render($param->NewWriter);
+ $this->$panel->setVisible(true);
+ } else {
+ $this->$panel->setVisible(false);
+ }
+ }
+ }
+ public function changePanel($sender,$param){
+ $this->showPanel($param->CallbackParameter, $param);
+ }
+ public function loadData_Callback($sender, $param){
+ die("parameter is ".$param->CallbackParameter);
+ }
+}
+
+?> \ No newline at end of file