From a7f6c6640ac9295eec3ae2edbb2250179eb85e33 Mon Sep 17 00:00:00 2001 From: wei <> Date: Sat, 6 May 2006 02:26:20 +0000 Subject: Adding TActiveButton and TActiveTextBox --- framework/Web/UI/WebControls/TTextBox.php | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) (limited to 'framework/Web/UI/WebControls/TTextBox.php') diff --git a/framework/Web/UI/WebControls/TTextBox.php b/framework/Web/UI/WebControls/TTextBox.php index feea6227..b443fa59 100644 --- a/framework/Web/UI/WebControls/TTextBox.php +++ b/framework/Web/UI/WebControls/TTextBox.php @@ -143,13 +143,20 @@ class TTextBox extends TWebControl implements IPostBackDataHandler, IValidatable if(!$isEnabled && $this->getEnabled()) // in this case parent will not render 'disabled' $writer->addAttribute('disabled','disabled'); if($isEnabled && $this->getAutoPostBack() && $page->getClientSupportsJavaScript()) - { - $writer->addAttribute('id',$this->getClientID()); - $this->getPage()->getClientScript()->registerPostBackControl('Prado.WebUI.TTextBox',$this->getPostBackOptions()); - } + $this->renderClientControlScript($writer); parent::addAttributesToRender($writer); } + /** + * Renders the javascript for textbox. + */ + protected function renderClientControlScript($writer) + { + $writer->addAttribute('id',$this->getClientID()); + $cs = $this->getPage()->getClientScript(); + $cs->registerPostBackControl(get_class($this),$this->getPostBackOptions()); + } + /** * Gets the post back options for this textbox. * @return array -- cgit v1.2.3