From ffc9318788952a879815cfa01a8b17b7ddae89b1 Mon Sep 17 00:00:00 2001 From: "ctrlaltca@gmail.com" <> Date: Thu, 2 Jun 2011 11:16:04 +0000 Subject: added documentation and examples for TActiveCheckBoxList, TActiveDropDownList, TActiveListBox, TActiveRadioButtonList classes --- .../Samples/TActiveDropDownList/Home.page | 108 +++++++++++++++++++++ .../Samples/TActiveDropDownList/Home.php | 60 ++++++++++++ 2 files changed, 168 insertions(+) create mode 100644 demos/quickstart/protected/pages/ActiveControls/Samples/TActiveDropDownList/Home.page create mode 100644 demos/quickstart/protected/pages/ActiveControls/Samples/TActiveDropDownList/Home.php (limited to 'demos/quickstart/protected/pages/ActiveControls/Samples/TActiveDropDownList') diff --git a/demos/quickstart/protected/pages/ActiveControls/Samples/TActiveDropDownList/Home.page b/demos/quickstart/protected/pages/ActiveControls/Samples/TActiveDropDownList/Home.page new file mode 100644 index 00000000..90ba4ea3 --- /dev/null +++ b/demos/quickstart/protected/pages/ActiveControls/Samples/TActiveDropDownList/Home.page @@ -0,0 +1,108 @@ + + +

TActiveDropDownList Samples

+ + + + + + + + +
+Callback dropdown list: + + + + + + + + +
+ + +

Changing items to DropDown Lists on callback

+ + + + + + + + +
+Adding an item on every callback: + + + + +
+ + + + + + + + +
+Clearing / restoring the dropdownlist on callback: + + + + + +
+ +

List Boxes with Validation

+ + + + + + + + + + + + + +
+Dropdown list is being validated: + + + + + + + + + +
+Dropdown list causing validation: + + + + + + + +
+ +
$Id$
\ No newline at end of file diff --git a/demos/quickstart/protected/pages/ActiveControls/Samples/TActiveDropDownList/Home.php b/demos/quickstart/protected/pages/ActiveControls/Samples/TActiveDropDownList/Home.php new file mode 100644 index 00000000..0ba728c6 --- /dev/null +++ b/demos/quickstart/protected/pages/ActiveControls/Samples/TActiveDropDownList/Home.php @@ -0,0 +1,60 @@ +IsPostBack && !$this->IsCallback) + { + $this->resetClicked(null,null); + } + } + + protected function collectSelectionResult($input,$output) + { + $indices=$input->SelectedIndices; + $result=''; + foreach($indices as $index) + { + $item=$input->Items[$index]; + $result.="(Index: $index, Value: $item->Value, Text: $item->Text)"; + } + if($result==='') + $output->Text='Your selection is empty.'; + else + $output->Text='Your selection is: '.$result; + } + + public function selectionChanged($sender,$param) + { + $this->collectSelectionResult($sender,$this->SelectionResult); + } + + public function buttonClicked($sender, $param) + { + $data=array(); + for($i = 0; $i <= $this->ddl1->Items->Count; $i++) + $data[$i]="Item number #".$i; + $this->ddl1->DataSource=$data; + $this->ddl1->dataBind(); + $this->label1->Text="Total ".count($data)." items"; + } + + public function resetClicked($sender, $param) + { + $data=array('item 1','item 2','item 3','item 4'); + $this->ddl2->DataSource=$data; + $this->ddl2->dataBind(); + $this->label2->Text="DropDownList has been reset"; + } + + public function clearClicked($sender, $param) + { + $this->ddl2->DataSource=array(); + $this->ddl2->dataBind(); + $this->label2->Text="DropDownList cleared"; + } +} + +?> \ No newline at end of file -- cgit v1.2.3