From 3dcb3c4188c8d5836a2db0847d2fc43bc7e7e4d8 Mon Sep 17 00:00:00 2001 From: xue <> Date: Mon, 20 Feb 2006 06:23:38 +0000 Subject: Cleaned up TForm and THead. --- framework/Web/UI/TClientScriptManager.php | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) (limited to 'framework/Web/UI/TClientScriptManager.php') diff --git a/framework/Web/UI/TClientScriptManager.php b/framework/Web/UI/TClientScriptManager.php index 2fe67308..5ff5dba6 100644 --- a/framework/Web/UI/TClientScriptManager.php +++ b/framework/Web/UI/TClientScriptManager.php @@ -173,6 +173,18 @@ class TClientScriptManager extends TApplicationComponent $this->registerPradoScript('prado'); } + /** + * Registers the control to receive default focus. + * @param TControl|string the control or the client ID of the HTML element to receive default focus + */ + public function registerFocusControl($target) + { + $this->registerPradoScript('prado'); + if($target instanceof TControl) + $target=$target->getClientID(); + $this->registerEndScript('prado:focus','Prado.Focus.setFocus("'.TJavaScript::quoteString($target).'");'); + } + /** * @return array default button options. */ @@ -418,12 +430,6 @@ class TClientScriptManager extends TApplicationComponent if($str!=='') $writer->write("
\n".$str."
\n"); } - - public function registerFocusScript($target) - { - $this->registerPradoScript('prado'); - $this->registerEndScript('prado:focus','Prado.Focus.setFocus("'.TJavaScript::quoteString($target).'");'); - } } ?> \ No newline at end of file -- cgit v1.2.3