From 8bebf49fbfb92f039f56cb22b759d8e84ef19799 Mon Sep 17 00:00:00 2001 From: tof <> Date: Thu, 18 Oct 2007 09:22:46 +0000 Subject: Fixed #722 - Add Read only capabilities to TInPlaceTextBox --- .../tickets/protected/pages/Ticket722.page | 6 +++++ .../tickets/protected/pages/Ticket722.php | 30 ++++++++++++++++++++++ 2 files changed, 36 insertions(+) create mode 100644 tests/FunctionalTests/tickets/protected/pages/Ticket722.page create mode 100644 tests/FunctionalTests/tickets/protected/pages/Ticket722.php (limited to 'tests/FunctionalTests/tickets/protected/pages') 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 @@ + +Click to edit ==> + + + + \ 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 @@ +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 -- cgit v1.2.3