summaryrefslogtreecommitdiff
path: root/framework/Web/UI/WebControls/TTextBox.php
diff options
context:
space:
mode:
authorxue <>2005-12-13 15:14:38 +0000
committerxue <>2005-12-13 15:14:38 +0000
commit1ed5d8c3f241116df31b92031ae18a2e6b5b3d4c (patch)
treea1a6b303f83294e17c4c20fb2e2b483a4e3d3d22 /framework/Web/UI/WebControls/TTextBox.php
parent597dcf809dac8ba80bf754dc5e02f8b7ff370c8b (diff)
Moved code for registering postback js from onPreRender to addAttributesToRender. It's too early to register js in onPreRender.
Diffstat (limited to 'framework/Web/UI/WebControls/TTextBox.php')
-rw-r--r--framework/Web/UI/WebControls/TTextBox.php22
1 files changed, 5 insertions, 17 deletions
diff --git a/framework/Web/UI/WebControls/TTextBox.php b/framework/Web/UI/WebControls/TTextBox.php
index 1ad736db..905cc1e1 100644
--- a/framework/Web/UI/WebControls/TTextBox.php
+++ b/framework/Web/UI/WebControls/TTextBox.php
@@ -117,22 +117,10 @@ class TTextBox extends TWebControl implements IPostBackDataHandler, IValidatable
$writer->addAttribute('readonly','readonly');
if(!$this->getEnabled(true) && $this->getEnabled()) // in this case parent will not render 'disabled'
$writer->addAttribute('disabled','disabled');
- parent::addAttributesToRender($writer);
- }
-
- /**
- * Registers the auto-postback javascript code.
- * If you override this method, be sure to call the parent implementation
- * so that the event handlers can be invoked.
- * @param TEventParameter event parameter to be passed to the event handlers
- */
- protected function onPreRender($param)
- {
- if($this->getAutoPostBack()
- && $this->getPage()->getClientSupportsJavaScript())
+ if($this->getAutoPostBack() && $page->getClientSupportsJavaScript())
{
$options = $this->getAutoPostBackOptions();
- $scripts = $this->getPage()->getClientScript();
+ $scripts = $this->getPage()->getClientScript();
$postback = $scripts->getPostBackEventReference($this,'',$options,false);
$scripts->registerClientEvent($this, "change", $postback);
@@ -142,12 +130,12 @@ class TTextBox extends TWebControl implements IPostBackDataHandler, IValidatable
$scripts->registerClientEvent($this, "keypress", $code);
}
}
- parent::onPreRender($param);
+ parent::addAttributesToRender($writer);
}
-
+
/**
* Sets the post back options for this textbox.
- * @return TPostBackOptions
+ * @return TPostBackOptions
*/
protected function getAutoPostBackOptions()
{