From 71ca767f51b53d6b162bd6fdccfb125f2dc94d35 Mon Sep 17 00:00:00 2001 From: xue <> Date: Fri, 30 Dec 2005 22:19:07 +0000 Subject: Added TListBox samples. --- framework/Exceptions/messages.txt | 1 + framework/Web/UI/TControl.php | 2 ++ framework/Web/UI/WebControls/TListControl.php | 4 +--- 3 files changed, 4 insertions(+), 3 deletions(-) (limited to 'framework') diff --git a/framework/Exceptions/messages.txt b/framework/Exceptions/messages.txt index c31c49d2..8547527f 100644 --- a/framework/Exceptions/messages.txt +++ b/framework/Exceptions/messages.txt @@ -130,6 +130,7 @@ theme_databind_forbidden = Databind cannot be used in theme '%s' for control theme_property_readonly = Skin is being applied to a read-only control property '%s.%s'. theme_property_undefined = Skin is being applied to an inexistent control property '%s.%s'. +control_object_reregistered = Duplicated object ID '%s' found. control_id_invalid = %s.ID '%s' is invalid. Only alphanumeric and underline characters are allowed. The first character must be an alphabetic or underline character. control_skinid_unchangeable = %s.SkinID cannot be modified after a skin has been applied to the control or the child controls have been created. control_enabletheming_unchangeable = %s.EnableTheming cannot be modified after the child controls have been created. diff --git a/framework/Web/UI/TControl.php b/framework/Web/UI/TControl.php index 372e87df..545bdf66 100644 --- a/framework/Web/UI/TControl.php +++ b/framework/Web/UI/TControl.php @@ -828,6 +828,8 @@ class TControl extends TComponent */ public function registerObject($name,$object) { + if(isset($this->_rf[self::RF_NAMED_OBJECTS][$name])) + throw new TInvalidOperationException('control_object_reregistered',$name); $this->_rf[self::RF_NAMED_OBJECTS][$name]=$object; } diff --git a/framework/Web/UI/WebControls/TListControl.php b/framework/Web/UI/WebControls/TListControl.php index 7e81fd6c..ec7df0c9 100644 --- a/framework/Web/UI/WebControls/TListControl.php +++ b/framework/Web/UI/WebControls/TListControl.php @@ -24,6 +24,7 @@ abstract class TListControl extends TDataBoundControl $writer->addAttribute('multiple','multiple'); if($this->getAutoPostBack() && $page->getClientSupportsJavaScript()) { + $writer->addAttribute('id',$this->getClientID()); $options = $this->getAutoPostBackOptions(); $scripts = $this->getPage()->getClientScript(); $postback = $scripts->getPostBackEventReference($this,'',$options,false); @@ -387,9 +388,6 @@ abstract class TListControl extends TDataBoundControl } } - - - class TListItemCollection extends TList { private $_items=null; -- cgit v1.2.3