summaryrefslogtreecommitdiff
path: root/tests/FunctionalTests/tickets/protected/pages
diff options
context:
space:
mode:
authortof <>2007-10-18 09:22:46 +0000
committertof <>2007-10-18 09:22:46 +0000
commit8bebf49fbfb92f039f56cb22b759d8e84ef19799 (patch)
tree6be47ae5ac609d31989eb1dad739e7823fd08ae2 /tests/FunctionalTests/tickets/protected/pages
parent56615eb9b1cef2e707f1163c74aaecc7e94ae549 (diff)
Fixed #722 - Add Read only capabilities to TInPlaceTextBox
Diffstat (limited to 'tests/FunctionalTests/tickets/protected/pages')
-rw-r--r--tests/FunctionalTests/tickets/protected/pages/Ticket722.page6
-rw-r--r--tests/FunctionalTests/tickets/protected/pages/Ticket722.php30
2 files changed, 36 insertions, 0 deletions
diff --git a/tests/FunctionalTests/tickets/protected/pages/Ticket722.page b/tests/FunctionalTests/tickets/protected/pages/Ticket722.page
new file mode 100644
index 00000000..6acd9f24
--- /dev/null
+++ b/tests/FunctionalTests/tickets/protected/pages/Ticket722.page
@@ -0,0 +1,6 @@
+<com:TContent ID="Content">
+<span id="label">Click to edit ==></span>
+<com:TInPlaceTextBox id="InPlaceTextBox" Text="Editable Text" ReadOnly="false" onTextChanged="onTextChanged"/>
+<com:TActiveButton Text="Change to Read Only" OnClick="ChangeState"/>
+
+</com:TContent> \ No newline at end of file
diff --git a/tests/FunctionalTests/tickets/protected/pages/Ticket722.php b/tests/FunctionalTests/tickets/protected/pages/Ticket722.php
new file mode 100644
index 00000000..91759fb0
--- /dev/null
+++ b/tests/FunctionalTests/tickets/protected/pages/Ticket722.php
@@ -0,0 +1,30 @@
+<?php
+
+prado::using ('System.Web.UI.ActiveControls.*');
+
+class Ticket722 extends TPage
+{
+ public function changeState ($sender, $param)
+ {
+ $state=$this->InPlaceTextBox->getReadOnly();
+ $this->InPlaceTextBox->setReadOnly(!$state);
+ $sender->setText($state?"Change to Read Only":"Change to Editable");
+ $this->InPlaceTextBox->setText($state?$this->getText():$this->getText().' [Read Only]');
+ }
+
+ public function onTextChanged ($sender, $param)
+ {
+ $this->setText($sender->getText());
+ }
+
+ public function setText ($value)
+ {
+ $this->setViewState('text', $value, "Editable Text");
+ }
+
+ public function getText ()
+ {
+ return $this->getViewState('text', "Editable Text");
+ }
+}
+?> \ No newline at end of file