From 3751bed4e3b40adb98949b85b47daf2cfaac29db Mon Sep 17 00:00:00 2001 From: xue <> Date: Wed, 14 Dec 2005 18:52:04 +0000 Subject: Added TDataBoundControl, TDropDownList and TListBox. Note, they're not done yet. --- framework/Web/UI/WebControls/TDropDownList.php | 42 ++++++++++++++++++++++++++ 1 file changed, 42 insertions(+) create mode 100644 framework/Web/UI/WebControls/TDropDownList.php (limited to 'framework/Web/UI/WebControls/TDropDownList.php') diff --git a/framework/Web/UI/WebControls/TDropDownList.php b/framework/Web/UI/WebControls/TDropDownList.php new file mode 100644 index 00000000..07549c6c --- /dev/null +++ b/framework/Web/UI/WebControls/TDropDownList.php @@ -0,0 +1,42 @@ +addAttribute('name',$this->getUniqueID()); + parent::addAttributesToRender($writer); + } + + public function loadPostData($key,$values) + { + if(!$this->getEnabled(true)) + return false; + // ensure DataBound??? + } + + public function raisePostDataChangedEvent() + { + $page=$this->getPage(); + if($this->getAutoPostBack() && !$page->getPostBackEventTarget()) + { + $page->setPostBackEventTarget($this); + if($this->getCausesValidation()) + $page->validate($this->getValidationGroup()); + } + $this->onSelectedIndexChanged(null); + } + + public function getSelectedIndex() + { + $index=parent::getSelectedIndex(); + if($index<0 && $this->getItems()->getCount()>0) + { + $this->setSelectedIndex(0); + return 0; + } + else + return $index; + } +} +?> \ No newline at end of file -- cgit v1.2.3