From 9af56fd93ed071d86f14296cec618073f6c0941a Mon Sep 17 00:00:00 2001 From: wei <> Date: Sat, 23 Sep 2006 01:08:19 +0000 Subject: Fixed #383 --- framework/Web/UI/ActiveControls/TActiveListBox.php | 25 ++++++++++++++++++++++ 1 file changed, 25 insertions(+) (limited to 'framework/Web/UI/ActiveControls/TActiveListBox.php') diff --git a/framework/Web/UI/ActiveControls/TActiveListBox.php b/framework/Web/UI/ActiveControls/TActiveListBox.php index 0620e734..e433fa09 100644 --- a/framework/Web/UI/ActiveControls/TActiveListBox.php +++ b/framework/Web/UI/ActiveControls/TActiveListBox.php @@ -13,6 +13,8 @@ /** * TActiveListBox class. * + * List items can be added dynamically during a callback request. + * * @author Wei Zhuo * @version $Id$ * @package System.Web.UI.ActiveControls @@ -40,6 +42,20 @@ class TActiveListBox extends TListBox implements IActiveControl, ICallbackEventH return $this->getAdapter()->getBaseActiveControl(); } + /** + * Creates a collection object to hold list items. A specialized + * TActiveListItemCollection is created to allow the drop down list options + * to be added. + * This method may be overriden to create a customized collection. + * @return TActiveListItemCollection the collection object + */ + protected function createListItemCollection() + { + $collection = new TActiveListItemCollection; + $collection->setControl($this); + return $collection; + } + /** * Javascript client class for this control. * This method overrides the parent implementation. @@ -95,6 +111,15 @@ class TActiveListBox extends TListBox implements IActiveControl, ICallbackEventH { $this->raiseEvent('OnCallback', $this, $param); } + + /** + * Updates the client-side options if the item list has changed after the OnLoad event. + */ + public function onPreRender($param) + { + parent::onPreRender($param); + $this->getAdapter()->updateListItems(); + } } ?> \ No newline at end of file -- cgit v1.2.3