From 67e09d150afe55d7a956beb299dc0534f7da68eb Mon Sep 17 00:00:00 2001 From: wei <> Date: Thu, 15 Jun 2006 00:56:57 +0000 Subject: Update active controls. Add comments. Add THttpResponseAdapter --- framework/Web/UI/ActiveControls/TAutoComplete.php | 29 ++++++++++++++++++----- 1 file changed, 23 insertions(+), 6 deletions(-) (limited to 'framework/Web/UI/ActiveControls/TAutoComplete.php') diff --git a/framework/Web/UI/ActiveControls/TAutoComplete.php b/framework/Web/UI/ActiveControls/TAutoComplete.php index 5a76847d..63b1d089 100644 --- a/framework/Web/UI/ActiveControls/TAutoComplete.php +++ b/framework/Web/UI/ActiveControls/TAutoComplete.php @@ -139,7 +139,7 @@ class TAutoComplete extends TActiveTextBox implements ICallbackEventHandler, INa { $this->getSuggestions()->render($writer); $boundary = $writer->getWriter()->getBoundary(); - $writer->getWriter()->getResponse()->setData($boundary); + $this->getResponse()->getAdapter()->setResponseData($boundary); } } @@ -162,17 +162,34 @@ class TAutoComplete extends TActiveTextBox implements ICallbackEventHandler, INa return $options; } + /** + * Override parent implementation, no javascript is rendered here instead + * the javascript required for active control is registered in {@link addAttributesToRender}. + */ + protected function renderClientControlScript($writer) + { + } + + /** + * Ensure that the ID attribute is rendered and registers the javascript code + * for initializing the active control. + */ + public function addAttributesToRender($writer) { parent::addAttributesToRender($writer); $writer->addAttribute('id',$this->getClientID()); - $this->getActiveControl()->registerCallbackClientScript($this->getAutoCompleteOptions()); + $this->getActiveControl()->registerCallbackClientScript( + $this->getClientClassName(), $this->getAutoCompleteOptions()); } - - protected function renderClientControlScript($writer) + + /** + * @return string corresponding javascript class name for this TActiveButton. + */ + protected function getClientClassName() { - - } + return 'Prado.WebUI.TAutoComplete'; + } } /** -- cgit v1.2.3