summaryrefslogtreecommitdiff
path: root/framework/Web/UI/ActiveControls/TInPlaceTextBox.php
diff options
context:
space:
mode:
authortof <>2007-10-18 09:22:46 +0000
committertof <>2007-10-18 09:22:46 +0000
commit8bebf49fbfb92f039f56cb22b759d8e84ef19799 (patch)
tree6be47ae5ac609d31989eb1dad739e7823fd08ae2 /framework/Web/UI/ActiveControls/TInPlaceTextBox.php
parent56615eb9b1cef2e707f1163c74aaecc7e94ae549 (diff)
Fixed #722 - Add Read only capabilities to TInPlaceTextBox
Diffstat (limited to 'framework/Web/UI/ActiveControls/TInPlaceTextBox.php')
-rw-r--r--framework/Web/UI/ActiveControls/TInPlaceTextBox.php24
1 files changed, 22 insertions, 2 deletions
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 <weizhuo[at]gmail[dot]com>
* @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;
}