summaryrefslogtreecommitdiff
path: root/framework/Web/UI/WebControls/TDropDownList.php
diff options
context:
space:
mode:
authorxue <>2005-12-14 18:52:04 +0000
committerxue <>2005-12-14 18:52:04 +0000
commit3751bed4e3b40adb98949b85b47daf2cfaac29db (patch)
treeae4de29ad414df7d40a92c5d4b525a4a6b431e4b /framework/Web/UI/WebControls/TDropDownList.php
parent3071d459eee19f9b01ec0a6241615562548d5fef (diff)
Added TDataBoundControl, TDropDownList and TListBox. Note, they're not done yet.
Diffstat (limited to 'framework/Web/UI/WebControls/TDropDownList.php')
-rw-r--r--framework/Web/UI/WebControls/TDropDownList.php42
1 files changed, 42 insertions, 0 deletions
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 @@
+<?php
+
+class TDropDownList extends TListControl implements IPostBackDataHandler
+{
+ protected function addAttributesToRender($writer)
+ {
+ $writer->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