From ae43fa72cdae13bace16a5b8250170e472bb2b87 Mon Sep 17 00:00:00 2001
From: wei <>
Date: Sun, 14 May 2006 00:30:53 +0000
Subject: refactor active controls.
---
.../pages/ActiveControls/ActiveControl.page | 11 ++----
.../pages/ActiveControls/ActiveControl.php | 5 ++-
.../pages/ActiveControls/AutoComplete.page | 2 +-
.../protected/pages/ActiveControls/Calculator.page | 9 ++++-
.../pages/ActiveControls/Calculator2.page | 40 ++++++++++++++++++++++
.../protected/pages/ActiveControls/Calculator2.php | 20 +++++++++++
.../pages/ActiveControls/VisibleUpdate.page | 9 +++++
.../pages/ActiveControls/VisibleUpdate.php | 36 +++++++++++++++++++
8 files changed, 121 insertions(+), 11 deletions(-)
create mode 100644 tests/FunctionalTests/features/protected/pages/ActiveControls/Calculator2.page
create mode 100644 tests/FunctionalTests/features/protected/pages/ActiveControls/Calculator2.php
create mode 100644 tests/FunctionalTests/features/protected/pages/ActiveControls/VisibleUpdate.page
create mode 100644 tests/FunctionalTests/features/protected/pages/ActiveControls/VisibleUpdate.php
(limited to 'tests/FunctionalTests/features')
diff --git a/tests/FunctionalTests/features/protected/pages/ActiveControls/ActiveControl.page b/tests/FunctionalTests/features/protected/pages/ActiveControls/ActiveControl.page
index 260ee805..9f17d4ed 100644
--- a/tests/FunctionalTests/features/protected/pages/ActiveControls/ActiveControl.page
+++ b/tests/FunctionalTests/features/protected/pages/ActiveControls/ActiveControl.page
@@ -1,15 +1,10 @@
TCallback Demo
-
-
+
-
+
@@ -35,7 +30,7 @@
+
+
\ No newline at end of file
diff --git a/tests/FunctionalTests/features/protected/pages/ActiveControls/Calculator2.php b/tests/FunctionalTests/features/protected/pages/ActiveControls/Calculator2.php
new file mode 100644
index 00000000..df07440f
--- /dev/null
+++ b/tests/FunctionalTests/features/protected/pages/ActiveControls/Calculator2.php
@@ -0,0 +1,20 @@
+c->Text = floatval($this->a->Text) + floatval($this->b->Text);
+ }
+
+ public function update_callback($sender, $param)
+ {
+ $this->do_sum($this->sum, null);
+ $this->panel1->renderControl($param->Output);
+ }
+}
+
+?>
\ No newline at end of file
diff --git a/tests/FunctionalTests/features/protected/pages/ActiveControls/VisibleUpdate.page b/tests/FunctionalTests/features/protected/pages/ActiveControls/VisibleUpdate.page
new file mode 100644
index 00000000..a8cb3c27
--- /dev/null
+++ b/tests/FunctionalTests/features/protected/pages/ActiveControls/VisibleUpdate.page
@@ -0,0 +1,9 @@
+
+ TCallback Demo
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/tests/FunctionalTests/features/protected/pages/ActiveControls/VisibleUpdate.php b/tests/FunctionalTests/features/protected/pages/ActiveControls/VisibleUpdate.php
new file mode 100644
index 00000000..0c9b16d5
--- /dev/null
+++ b/tests/FunctionalTests/features/protected/pages/ActiveControls/VisibleUpdate.php
@@ -0,0 +1,36 @@
+label1->setText($this->getButtonState($sender));
+
+ //$this->button1->setEnabled(false);
+ $this->button1->setVisible(false);
+ // $this->button2->setEnabled(true);
+ $this->button2->setVisible(true);
+ }
+
+ function click2($sender)
+ {
+ $this->label1->setText($this->getButtonState($sender));
+
+ // $this->button1->setEnabled(true);
+ $this->button1->setVisible(true);
+ /// $this->button2->setEnabled(false);
+ $this->button2->setVisible(false);
+ }
+
+ protected function getButtonState($button)
+ {
+ return "Before you clicked on ".$button->Text.
+ ", Button 1 was ".($this->button1->Enabled ? 'enabled' : 'disabled').
+ " and Button 2 was ".($this->button2->Enabled ? 'enabled' : 'disabled');
+ }
+}
+
+?>
\ No newline at end of file
--
cgit v1.2.3