diff options
Diffstat (limited to 'framework/Web/UI/ActiveControls/TActiveTextBox.php')
-rw-r--r-- | framework/Web/UI/ActiveControls/TActiveTextBox.php | 28 |
1 files changed, 19 insertions, 9 deletions
diff --git a/framework/Web/UI/ActiveControls/TActiveTextBox.php b/framework/Web/UI/ActiveControls/TActiveTextBox.php index 8e6c86dd..c7ee916d 100644 --- a/framework/Web/UI/ActiveControls/TActiveTextBox.php +++ b/framework/Web/UI/ActiveControls/TActiveTextBox.php @@ -93,23 +93,33 @@ class TActiveTextBox extends TTextBox implements ICallbackEventHandler, IActiveC }
/**
- * Renders the javascript for textbox.
+ * Gets the name of the javascript class responsible for performing postback for this control.
+ * This method overrides the parent implementation.
+ * @return string the javascript class name
+ */
+ protected function getClientClassName()
+ {
+ return 'Prado.WebUI.TActiveTextBox';
+ }
+
+ /**
+ * Override parent implementation, no javascript is rendered here instead
+ * the javascript required for active control is registered in {@link addAttributesToRender}.
*/
protected function renderClientControlScript($writer)
{
- $writer->addAttribute('id',$this->getClientID());
- $this->getActiveControl()->registerCallbackClientScript(
- $this->getClientClassName(), $this->getPostBackOptions());
}
/**
- * Gets the name of the javascript class responsible for performing postback for this control.
- * This method overrides the parent implementation.
- * @return string the javascript class name
+ * Ensure that the ID attribute is rendered and registers the javascript code
+ * for initializing the active control.
*/
- protected function getClientClassName()
+ protected function addAttributesToRender($writer)
{
- return 'Prado.WebUI.TActiveTextBox';
+ parent::addAttributesToRender($writer);
+ $writer->addAttribute('id',$this->getClientID());
+ $this->getActiveControl()->registerCallbackClientScript(
+ $this->getClientClassName(), $this->getPostBackOptions());
}
}
|