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 --- .../Web/UI/ActiveControls/TInPlaceTextBox.php | 24 ++++++++++++++++++++-- 1 file changed, 22 insertions(+), 2 deletions(-) (limited to 'framework/Web/UI/ActiveControls') diff --git a/framework/Web/UI/ActiveControls/TInPlaceTextBox.php b/framework/Web/UI/ActiveControls/TInPlaceTextBox.php index 4c75aa2b..4bc70149 100644 --- a/framework/Web/UI/ActiveControls/TInPlaceTextBox.php +++ b/framework/Web/UI/ActiveControls/TInPlaceTextBox.php @@ -35,7 +35,10 @@ Prado::using('System.Web.UI.ActiveControls.TActiveTextBox'); * After the callback request returns sucessfully, the textbox is enabled. * If the {@link setAutoHideTextBox AutoHideTextBox} property is true, then * the textbox will be hidden and the label is then shown. - * + * + * Since 3.1.2, you can set the {@link setReadOnly ReadOnly} property to make + * the control not editable. This property can be also changed on callback + * * @author Wei Zhuo * @version $Id$ * @package System.Web.UI.ActiveControls @@ -141,6 +144,21 @@ class TInPlaceTextBox extends TActiveTextBox $client->update($this->getLabelClientID(), $value); $client->setValue($this, $value); } + } + + /** + * Update ClientSide Readonly property + * @param boolean value + * @since 3.1.2 + */ + public function setReadOnly ($value) + { + $value=TPropertyValue::ensureBoolean($value); + TTextBox::setReadOnly($value); + if ($this->getActiveControl()->canUpdateClientSide()) + { + $this->callClientFunction('setReadOnly', $value); + } } /** @@ -213,7 +231,9 @@ class TInPlaceTextBox extends TActiveTextBox } if($this->hasEventHandler('OnLoadingText')) - $options['LoadTextOnEdit'] = true; + $options['LoadTextOnEdit'] = true; + + $options['ReadOnly']=$this->getReadOnly(); return $options; } -- cgit v1.2.3