From 3d0ecbdc3141740be8d9ddda0a2c6f293dbc099c Mon Sep 17 00:00:00 2001
From: Fabio Bas <ctrlaltca@gmail.com>
Date: Tue, 25 Mar 2014 20:11:16 +0100
Subject: Fix #504

---
 framework/Web/UI/WebControls/TPanel.php | 7 +------
 1 file changed, 1 insertion(+), 6 deletions(-)

(limited to 'framework/Web/UI/WebControls')

diff --git a/framework/Web/UI/WebControls/TPanel.php b/framework/Web/UI/WebControls/TPanel.php
index 2256420b..2bf1b40d 100644
--- a/framework/Web/UI/WebControls/TPanel.php
+++ b/framework/Web/UI/WebControls/TPanel.php
@@ -229,12 +229,7 @@ class TPanel extends TWebControl
 
 		if(($butt=$this->getDefaultButton())!=='')
 		{
-			$buttons = $this->findControlsByID($butt);
-			if (count($buttons)>0)
-				$button = reset($buttons);
-			else
-				$button = null;
-			if($button===null)
+			if(($button=$this->findControl($butt))===null)
 				throw new TInvalidDataValueException('panel_defaultbutton_invalid',$butt);
 			else
 				$this->getPage()->getClientScript()->registerDefaultButton($this, $button);
-- 
cgit v1.2.3