From 28a78f7306d1952a5efb4b8b8a6432f41bf5f4cf Mon Sep 17 00:00:00 2001 From: "Christophe.Boulain" <> Date: Wed, 29 Apr 2009 06:22:27 +0000 Subject: Ensure rendering of clientID in TActivePanel --- framework/Web/UI/ActiveControls/TActivePanel.php | 31 +++++++++++++++--------- 1 file changed, 20 insertions(+), 11 deletions(-) (limited to 'framework/Web/UI/ActiveControls/TActivePanel.php') diff --git a/framework/Web/UI/ActiveControls/TActivePanel.php b/framework/Web/UI/ActiveControls/TActivePanel.php index 51e9fb08..25a42eb7 100644 --- a/framework/Web/UI/ActiveControls/TActivePanel.php +++ b/framework/Web/UI/ActiveControls/TActivePanel.php @@ -4,7 +4,7 @@ * * @author Wei Zhuo * @link http://www.pradosoft.com/ - * @copyright Copyright © 2005-2008 PradoSoft + * @copyright Copyright © 2005-2008 PradoSoft * @license http://www.pradosoft.com/license/ * @version $Id$ * @package System.Web.UI.ActiveControls @@ -57,6 +57,15 @@ class TActivePanel extends TPanel implements IActiveControl return $this->getAdapter()->getBaseActiveControl(); } + /** + * Adds attribute id to the renderer. + * @param THtmlWriter the writer used for the rendering purpose + */ + protected function addAttributesToRender($writer) { + $writer->addAttribute('id',$this->getClientID()); + parent::addAttributesToRender($writer); + } + /** * Renders and replaces the panel's content on the client-side. * When render() is called before the OnPreRender event, such as when render() @@ -74,16 +83,16 @@ class TActivePanel extends TPanel implements IActiveControl } else { - $this->getPage()->getAdapter()->registerControlToRender($this,$writer); - if ($this->getHasControls()) - { - // If we update a TActivePanel on callback, - // We shouldn't update all childs, because the whole content will be replaced by - // the parent - foreach ($this->findControlsByType('IActiveControl', false) as $control) - { - $control->getActiveControl()->setEnableUpdate(false); - } + $this->getPage()->getAdapter()->registerControlToRender($this,$writer); + if ($this->getHasControls()) + { + // If we update a TActivePanel on callback, + // We shouldn't update all childs, because the whole content will be replaced by + // the parent + foreach ($this->findControlsByType('IActiveControl', false) as $control) + { + $control->getActiveControl()->setEnableUpdate(false); + } } } } -- cgit v1.2.3