diff options
Diffstat (limited to 'demos/quickstart/protected/pages/Controls/Samples')
-rw-r--r-- | demos/quickstart/protected/pages/Controls/Samples/TCheckBoxList/Home.page | 23 | ||||
-rw-r--r-- | demos/quickstart/protected/pages/Controls/Samples/TCheckBoxList/Home.php | 52 |
2 files changed, 75 insertions, 0 deletions
diff --git a/demos/quickstart/protected/pages/Controls/Samples/TCheckBoxList/Home.page b/demos/quickstart/protected/pages/Controls/Samples/TCheckBoxList/Home.page new file mode 100644 index 00000000..04d6e91b --- /dev/null +++ b/demos/quickstart/protected/pages/Controls/Samples/TCheckBoxList/Home.page @@ -0,0 +1,23 @@ +<com:TContent ID="body">
+
+<h1>TCheckBoxList Samples</h1>
+
+<table class="sampletable">
+
+<tr>
+<td class="samplenote">
+Check box list with initial items:
+</td>
+<td class="sampleaction">
+<com:TCheckBoxList RepeatLayout="Flow" RepeatDirection="Horizontal" RepeatColumns="2">
+ <com:TListItem Value="value 1" Text="item 1" />
+ <com:TListItem Value="value 2" Text="item 2" Selected="true" />
+ <com:TListItem Value="value 3" Text="item 3" />
+ <com:TListItem Value="value 4" Text="item 4" Selected="true" />
+</com:TCheckBoxList>
+</td>
+</tr>
+
+</table>
+
+</com:TContent>
\ No newline at end of file diff --git a/demos/quickstart/protected/pages/Controls/Samples/TCheckBoxList/Home.php b/demos/quickstart/protected/pages/Controls/Samples/TCheckBoxList/Home.php new file mode 100644 index 00000000..6b1d07e1 --- /dev/null +++ b/demos/quickstart/protected/pages/Controls/Samples/TCheckBoxList/Home.php @@ -0,0 +1,52 @@ +<?php
+
+class Home extends TPage
+{
+ public function selectionChanged($sender,$param)
+ {
+ $index=$sender->SelectedIndex;
+ $value=$sender->SelectedValue;
+ $text=$sender->SelectedItem->Text;
+ $this->SelectionResult->Text="Your selection is (Index: $index, Value: $value, Text: $text).";
+ }
+
+ public function buttonClicked($sender,$param)
+ {
+ $index=$this->ListBox1->SelectedIndex;
+ $value=$this->ListBox1->SelectedValue;
+ $text=$this->ListBox1->SelectedItem->Text;
+ $this->SelectionResult2->Text="Your selection is (Index: $index, Value: $value, Text: $text).";
+ }
+
+ public function multiSelectionChanged($sender,$param)
+ {
+ $indices=$sender->SelectedIndices;
+ $result='';
+ foreach($indices as $index)
+ {
+ $item=$sender->Items[$index];
+ $result.="(Index: $index, Value: $item->Value, Text: $item->Text)\n";
+ }
+ if($result==='')
+ $this->MultiSelectionResult->Text='Your selection is empty.';
+ else
+ $this->MultiSelectionResult->Text='Your selection is: '.$result;
+ }
+
+ public function buttonClicked2($sender,$param)
+ {
+ $indices=$this->ListBox2->SelectedIndices;
+ $result='';
+ foreach($indices as $index)
+ {
+ $item=$this->ListBox2->Items[$index];
+ $result.="(Index: $index, Value: $item->Value, Text: $item->Text)\n";
+ }
+ if($result==='')
+ $this->MultiSelectionResult2->Text='Your selection is empty.';
+ else
+ $this->MultiSelectionResult2->Text='Your selection is: '.$result;
+ }
+}
+
+?>
\ No newline at end of file |