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/TActiveCheckBoxList/Home.page | 66 +++++++++++++ .../Samples/TActiveCheckBoxList/Home.php | 26 +++++ .../Samples/TActiveDropDownList/Home.page | 108 +++++++++++++++++++++ .../Samples/TActiveDropDownList/Home.php | 60 ++++++++++++ .../Samples/TActiveListBox/Home.page | 108 +++++++++++++++++++++ .../ActiveControls/Samples/TActiveListBox/Home.php | 60 ++++++++++++ .../Samples/TActiveRadioButtonList/Home.page | 66 +++++++++++++ .../Samples/TActiveRadioButtonList/Home.php | 26 +++++ 8 files changed, 520 insertions(+) create mode 100644 demos/quickstart/protected/pages/ActiveControls/Samples/TActiveCheckBoxList/Home.page create mode 100644 demos/quickstart/protected/pages/ActiveControls/Samples/TActiveCheckBoxList/Home.php create mode 100644 demos/quickstart/protected/pages/ActiveControls/Samples/TActiveDropDownList/Home.page create mode 100644 demos/quickstart/protected/pages/ActiveControls/Samples/TActiveDropDownList/Home.php create mode 100644 demos/quickstart/protected/pages/ActiveControls/Samples/TActiveListBox/Home.page create mode 100644 demos/quickstart/protected/pages/ActiveControls/Samples/TActiveListBox/Home.php create mode 100644 demos/quickstart/protected/pages/ActiveControls/Samples/TActiveRadioButtonList/Home.page create mode 100644 demos/quickstart/protected/pages/ActiveControls/Samples/TActiveRadioButtonList/Home.php (limited to 'demos/quickstart/protected/pages/ActiveControls/Samples') diff --git a/demos/quickstart/protected/pages/ActiveControls/Samples/TActiveCheckBoxList/Home.page b/demos/quickstart/protected/pages/ActiveControls/Samples/TActiveCheckBoxList/Home.page new file mode 100644 index 00000000..71b83c5a --- /dev/null +++ b/demos/quickstart/protected/pages/ActiveControls/Samples/TActiveCheckBoxList/Home.page @@ -0,0 +1,66 @@ + + +

TActiveCheckBoxList Samples

+ + + + + + + + + + + + + +
+Check box list with default settings: + + + + + + + +
+Check box list's behavior upon callback: + + + + + + + + +
+ +
+ + +

CheckBox List with Validation

+ + + + + + + + +
+CheckBox list causing validation: + + + + + + + +
+ +
$Id$
\ No newline at end of file diff --git a/demos/quickstart/protected/pages/ActiveControls/Samples/TActiveCheckBoxList/Home.php b/demos/quickstart/protected/pages/ActiveControls/Samples/TActiveCheckBoxList/Home.php new file mode 100644 index 00000000..3644721e --- /dev/null +++ b/demos/quickstart/protected/pages/ActiveControls/Samples/TActiveCheckBoxList/Home.php @@ -0,0 +1,26 @@ +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($this->CheckBoxList,$this->SelectionResult); + } +} + +?> \ No newline at end of file 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 diff --git a/demos/quickstart/protected/pages/ActiveControls/Samples/TActiveListBox/Home.page b/demos/quickstart/protected/pages/ActiveControls/Samples/TActiveListBox/Home.page new file mode 100644 index 00000000..b23b644d --- /dev/null +++ b/demos/quickstart/protected/pages/ActiveControls/Samples/TActiveListBox/Home.page @@ -0,0 +1,108 @@ + + +

TActiveListBox Samples

+ + + + + + + + +
+Callback listbox: + + + + + + + + +
+ + +

Changing items to a Listbox on callback

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

List Boxes with Validation

+ + + + + + + + + + + + + +
+Listbox is being validated: + + + + + + + + + +
+Listbox causing validation: + + + + + + + +
+ +
$Id$
\ No newline at end of file diff --git a/demos/quickstart/protected/pages/ActiveControls/Samples/TActiveListBox/Home.php b/demos/quickstart/protected/pages/ActiveControls/Samples/TActiveListBox/Home.php new file mode 100644 index 00000000..5ec96613 --- /dev/null +++ b/demos/quickstart/protected/pages/ActiveControls/Samples/TActiveListBox/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->box1->Items->Count; $i++) + $data[$i]="Item number #".$i; + $this->box1->DataSource=$data; + $this->box1->dataBind(); + $this->label1->Text="Total ".count($data)." items"; + } + + public function resetClicked($sender, $param) + { + $data=array('item 1','item 2','item 3','item 4'); + $this->box2->DataSource=$data; + $this->box2->dataBind(); + $this->label2->Text="ListBox has been reset"; + } + + public function clearClicked($sender, $param) + { + $this->box2->DataSource=array(); + $this->box2->dataBind(); + $this->label2->Text="ListBox cleared"; + } +} + +?> \ No newline at end of file diff --git a/demos/quickstart/protected/pages/ActiveControls/Samples/TActiveRadioButtonList/Home.page b/demos/quickstart/protected/pages/ActiveControls/Samples/TActiveRadioButtonList/Home.page new file mode 100644 index 00000000..1e3a185f --- /dev/null +++ b/demos/quickstart/protected/pages/ActiveControls/Samples/TActiveRadioButtonList/Home.page @@ -0,0 +1,66 @@ + + +

TActiveRadioButtonList Samples

+ + + + + + + + + + + + + +
+Check box list with default settings: + + + + + + + +
+Check box list's behavior upon callback: + + + + + + + + +
+ +
+ + +

RadioButton List with Validation

+ + + + + + + + +
+RadioButton list causing validation: + + + + + + + +
+ +
$Id$
\ No newline at end of file diff --git a/demos/quickstart/protected/pages/ActiveControls/Samples/TActiveRadioButtonList/Home.php b/demos/quickstart/protected/pages/ActiveControls/Samples/TActiveRadioButtonList/Home.php new file mode 100644 index 00000000..dfa52ce4 --- /dev/null +++ b/demos/quickstart/protected/pages/ActiveControls/Samples/TActiveRadioButtonList/Home.php @@ -0,0 +1,26 @@ +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($this->RadioButtonList,$this->SelectionResult); + } +} + +?> \ No newline at end of file -- cgit v1.2.3