summaryrefslogtreecommitdiff
path: root/framework/Web/UI/TPage.php
diff options
context:
space:
mode:
Diffstat (limited to 'framework/Web/UI/TPage.php')
-rw-r--r--framework/Web/UI/TPage.php8
1 files changed, 3 insertions, 5 deletions
diff --git a/framework/Web/UI/TPage.php b/framework/Web/UI/TPage.php
index bbfca2fe..aa188a03 100644
--- a/framework/Web/UI/TPage.php
+++ b/framework/Web/UI/TPage.php
@@ -690,13 +690,11 @@ class TPage extends TTemplateControl
{
if($this->_focus)
{
- if(is_string($this->_focus))
- $cs->registerFocusScript($this->_focus);
- else if(($this->_focus instanceof TControl) && $this->_focus->getVisible(true))
- $cs->registerFocusScript($this->_focus->getClientID());
+ if(($this->_focus instanceof TControl) && $this->_focus->getVisible(true) || is_string($this->_focus))
+ $cs->registerFocusControl($this->_focus);
}
else if($this->_postData && ($lastFocus=$this->_postData->itemAt(self::FIELD_LASTFOCUS))!==null)
- $cs->registerFocusScript($lastFocus);
+ $cs->registerFocusControl($lastFocus);
$cs->renderHiddenFields($writer);
$cs->renderScriptFiles($writer);
$cs->renderEndScripts($writer);