diff options
author | xue <> | 2005-12-31 01:56:58 +0000 |
---|---|---|
committer | xue <> | 2005-12-31 01:56:58 +0000 |
commit | e050f7f5e259ffc9df018a7021e8ed946b4d614e (patch) | |
tree | 7f9c12ac56ba77052a9227c5d231e6cff97bf7f8 /demos | |
parent | 21b205564dd4a6602a29b48fb314c4d3d5130ef6 (diff) |
Added TDropDownList samples.
Diffstat (limited to 'demos')
3 files changed, 121 insertions, 1 deletions
diff --git a/demos/quickstart/protected/pages/Controls/List.page b/demos/quickstart/protected/pages/Controls/List.page index 4a3610fc..f305580b 100644 --- a/demos/quickstart/protected/pages/Controls/List.page +++ b/demos/quickstart/protected/pages/Controls/List.page @@ -1,14 +1,21 @@ <com:TContent ID="body" >
<h1>List Controls</h1>
+<p>
+List controls covered in this section are all inherit directly or indirectly from <tt>TDataBoundControl</tt>. Therefore, you can do various databinding operations with them. More details about databinding will be given in later sections.
+</p>
<h2>TListBox</h2>
<p>
-<tt>TListBox</tt> displays a list box that allows single or multiple selection. Set the property <tt>SelectionMode</tt> as <tt>Single</tt> to make a single selection list box, and <tt>Multiple</tt> a multiple selection list box. The items in the list box are represented by the <tt>Items</tt> property. The number of rows displayed in the box is specified via the <tt>Rows</tt> property value. Some other important properties that <tt>TListBox</tt> inherits from <tt>TListControl</tt> include: <tt>Items</tt>, <tt>SelectedIndex</tt>, <tt>SelectedIndices</tt>, <tt>SelectedItem</tt>, <tt>SelectedValue</tt>, <tt>AutoPostBack</tt> and <tt>CausesValidation</tt>. Note, since <tt>TDataBoundControl</tt> is an ancestor class of <tt>TListBox</tt>, you can do various databinding operations with a list box control. More details are covered in sections about databinding.
+<tt>TListBox</tt> displays a list box that allows single or multiple selection. Set the property <tt>SelectionMode</tt> as <tt>Single</tt> to make a single selection list box, and <tt>Multiple</tt> a multiple selection list box. The items in the list box are represented by the <tt>Items</tt> property. The number of rows displayed in the box is specified via the <tt>Rows</tt> property value. Some other important properties that <tt>TListBox</tt> inherits from <tt>TListControl</tt> include: <tt>Items</tt>, <tt>SelectedIndex</tt>, <tt>SelectedIndices</tt>, <tt>SelectedItem</tt>, <tt>SelectedValue</tt>, <tt>AutoPostBack</tt> and <tt>CausesValidation</tt>.
</p>
<com:RunBar PagePath="Controls.Samples.TListBox.Home" />
<h2>TDropDownList</h2>
+<p>
+<tt>TDropDownList</tt> displays a dropdown list box that allows users to select a single option from a few prespecified ones. The items in the list box are represented by the <tt>Items</tt> property. The selected item can be retrieved via <tt>SelectedItem</tt> property. If <tt>AutoPostBack</tt> is true, selection change will cause page postback.
+</p>
+<com:RunBar PagePath="Controls.Samples.TDropDownList.Home" />
<h2>TCheckBoxList</h2>
diff --git a/demos/quickstart/protected/pages/Controls/Samples/TDropDownList/Home.page b/demos/quickstart/protected/pages/Controls/Samples/TDropDownList/Home.page new file mode 100644 index 00000000..9b82a969 --- /dev/null +++ b/demos/quickstart/protected/pages/Controls/Samples/TDropDownList/Home.page @@ -0,0 +1,91 @@ +<com:TContent ID="body">
+
+<h1>TDropDownList Samples</h1>
+
+<table class="sampletable">
+
+<tr>
+<td class="samplenote">
+Dropdown list with default settings:
+</td>
+<td class="sampleaction">
+<com:TDropDownList />
+</td>
+</tr>
+
+<tr>
+<td class="samplenote">
+Dropdown list with initial items:
+</td>
+<td class="sampleaction">
+<com:TDropDownList>
+ <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" />
+</com:TDropDownList>
+</td>
+</tr>
+
+<tr>
+<td class="samplenote">
+List box with customized row number, color and font:
+</td>
+<td class="sampleaction">
+<com:TDropDownList Rows="3" ForeColor="blue" Font.Size="14pt">
+ <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" />
+</com:TDropDownList>
+</td>
+</tr>
+
+<tr>
+<td class="samplenote">
+Disabled Dropdown list:
+</td>
+<td class="sampleaction">
+<com:TDropDownList Enabled="false">
+ <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" />
+</com:TDropDownList>
+</td>
+</tr>
+
+<tr>
+<td class="samplenote">
+Auto postback Dropdown list:
+</td>
+<td class="sampleaction">
+<com:TDropDownList AutoPostBack="true" SelectedIndexChanged="selectionChanged">
+ <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" />
+</com:TDropDownList>
+<com:TLabel ID="SelectionResult" ForeColor="red" />
+</td>
+</tr>
+
+<tr>
+<td class="samplenote">
+Dropdown list's behavior upon postback:
+</td>
+<td class="sampleaction">
+<com:TDropDownList ID="ListBox1">
+ <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" />
+</com:TDropDownList>
+<com:TButton Text="Submit" Click="buttonClicked"/>
+<com:TLabel ID="SelectionResult2" ForeColor="red" />
+</td>
+</tr>
+
+</table>
+
+</com:TContent>
\ No newline at end of file diff --git a/demos/quickstart/protected/pages/Controls/Samples/TDropDownList/Home.php b/demos/quickstart/protected/pages/Controls/Samples/TDropDownList/Home.php new file mode 100644 index 00000000..3835d3c3 --- /dev/null +++ b/demos/quickstart/protected/pages/Controls/Samples/TDropDownList/Home.php @@ -0,0 +1,22 @@ +<?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).";
+ }
+}
+
+?>
\ No newline at end of file |