From cda44920115f2aadd7c3fbe2df13cb48a2cbc0c5 Mon Sep 17 00:00:00 2001 From: "ctrlaltca@gmail.com" <> Date: Sat, 25 Jun 2011 09:08:40 +0000 Subject: applied further "progressive rendering" patches (#235) added TFlushOutput component fixed THtmlarea quickstart demo --- framework/Web/UI/WebControls/TPanel.php | 30 ++++++++++++++++++++---------- 1 file changed, 20 insertions(+), 10 deletions(-) (limited to 'framework/Web/UI/WebControls/TPanel.php') diff --git a/framework/Web/UI/WebControls/TPanel.php b/framework/Web/UI/WebControls/TPanel.php index cf21eeef..227a9a3e 100644 --- a/framework/Web/UI/WebControls/TPanel.php +++ b/framework/Web/UI/WebControls/TPanel.php @@ -4,7 +4,7 @@ * * @author Qiang Xue * @link http://www.pradosoft.com/ - * @copyright Copyright © 2005-2011 PradoSoft + * @copyright Copyright © 2005-2011 PradoSoft * @license http://www.pradosoft.com/license/ * @version $Id$ * @package System.Web.UI.WebControls @@ -73,15 +73,7 @@ class TPanel extends TWebControl { parent::addAttributesToRender($writer); if(($butt=$this->getDefaultButton())!=='') - { - if(($button=$this->findControl($butt))===null) - throw new TInvalidDataValueException('panel_defaultbutton_invalid',$butt); - else - { - $writer->addAttribute('id',$this->getClientID()); - $this->getPage()->getClientScript()->registerDefaultButton($this, $button); - } - } + $writer->addAttribute('id',$this->getClientID()); } /** @@ -232,5 +224,23 @@ class TPanel extends TWebControl $writer->renderEndTag(); parent::renderEndTag($writer); } + + public function render($writer) + { + parent::render($writer); + + if(($butt=$this->getDefaultButton())!=='') + { + $buttons = $this->findControlsByID($butt); + if (count($buttons)>0) + $button = reset($buttons); + else + $buttons = null; + if($button===null) + throw new TInvalidDataValueException('panel_defaultbutton_invalid',$butt); + else + $this->getPage()->getClientScript()->registerDefaultButton($this, $button); + } + } } -- cgit v1.2.3