summaryrefslogtreecommitdiff
path: root/demos
diff options
context:
space:
mode:
authorxue <>2006-01-21 15:25:10 +0000
committerxue <>2006-01-21 15:25:10 +0000
commitdd76d0c2cfa3425c2e8dad54f2bcb12148957db5 (patch)
treec8a4d485b11fe21804d6f4254e69f3da868aca36 /demos
parentfe344abe284632c5a5d0c0317fc6d28f30934036 (diff)
Added TLinkButton demos.
Diffstat (limited to 'demos')
-rw-r--r--demos/quickstart/protected/pages/Controls/List.page24
-rw-r--r--demos/quickstart/protected/pages/Controls/Samples/TButton/Home.page2
-rw-r--r--demos/quickstart/protected/pages/Controls/Samples/TLinkButton/Home.page58
-rw-r--r--demos/quickstart/protected/pages/Controls/Samples/TLinkButton/Home.php14
-rw-r--r--demos/quickstart/protected/pages/Controls/Simple.page2
5 files changed, 96 insertions, 4 deletions
diff --git a/demos/quickstart/protected/pages/Controls/List.page b/demos/quickstart/protected/pages/Controls/List.page
index 5b0e766a..557a8c6f 100644
--- a/demos/quickstart/protected/pages/Controls/List.page
+++ b/demos/quickstart/protected/pages/Controls/List.page
@@ -2,12 +2,32 @@
<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.
+List controls covered in this section all inherit directly or indirectly from <tt>TListControl</tt>. Therefore, they share the same set of commonly used properties, including,
+<ul>
+<li><tt>Items</tt> - list of items in the control. The items are of type <tt>TListItem</tt>. The item list can be populated via databinding or specified in templates like the following:
+<com:TTextHighlighter Language="prado" CssClass="source">
+&lt;com:TListBox&gt;
+ &lt;com:TListItem Text="text 1" Value="value 1" /&gt;
+ &lt;com:TListItem Text="text 2" Value="value 2" Selected="true" /&gt;
+ &lt;com:TListItem Text="text 3" Value="value 3" /&gt;
+&lt;/com:TListBox&gt;
+</com:TTextHighlighter>
+</li>
+<li><tt>SelectedIndex</tt> - the zero-based index of the first selected item in the item list.</li>
+<li><tt>SelectedIndices</tt> - the indices of all selected items.</li>
+<li><tt>SelectedItem</tt> - the first selected item in the item list.</li>
+<li><tt>SelectedValue</tt> - the value of the first selected item in the item list.</li>
+<li><tt>AutoPostBack</tt> - whether changing the selection of the control should trigger postback.</li>
+<li><tt>CausesValidation</tt> - whether validation should be performed when postback is triggered by the list control.</li>
+</ul>
+</p>
+<p>
+Since <tt>TListControl</tt> inherits from <tt>TDataBoundControl</tt>, these list controls also share a common operation known as <tt>databinding</tt>. The data to be bound can be specified via either <tt>DataSource</tt> or <tt>DataSourceID</tt>. More details about databinding are covered in later chapters of this tutorial.
</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>.
+<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.
</p>
<com:RunBar PagePath="Controls.Samples.TListBox.Home" />
diff --git a/demos/quickstart/protected/pages/Controls/Samples/TButton/Home.page b/demos/quickstart/protected/pages/Controls/Samples/TButton/Home.page
index 7c5b90b4..eb1bc235 100644
--- a/demos/quickstart/protected/pages/Controls/Samples/TButton/Home.page
+++ b/demos/quickstart/protected/pages/Controls/Samples/TButton/Home.page
@@ -5,7 +5,7 @@
<table class="sampletable">
<tr><td class="samplenote">
-Button with customized color, font, columns, maximum length:
+Button with customized color, font and width:
</td><td class="sampleaction">
<com:TButton
Text="text"
diff --git a/demos/quickstart/protected/pages/Controls/Samples/TLinkButton/Home.page b/demos/quickstart/protected/pages/Controls/Samples/TLinkButton/Home.page
new file mode 100644
index 00000000..497e5083
--- /dev/null
+++ b/demos/quickstart/protected/pages/Controls/Samples/TLinkButton/Home.page
@@ -0,0 +1,58 @@
+<com:TContent ID="body">
+
+<h1>TLinkButton Samples</h1>
+
+<table class="sampletable">
+
+<tr><td class="samplenote">
+Link button with customized color and font:
+</td><td class="sampleaction">
+<com:TLinkButton
+ Text="link button"
+ ForeColor="silver"
+ BackColor="black"
+ Font.Size="14pt"
+/>
+</td></tr>
+
+<tr><td class="samplenote">
+Link button with only body content:
+</td><td class="sampleaction">
+<com:TLinkButton>
+body content
+</com:TLinkButton>
+</td></tr>
+
+<tr><td class="samplenote">
+A click link button:
+</td><td class="sampleaction">
+<com:TLinkButton Text="click me" Click="buttonClicked" />
+</td></tr>
+
+<tr><td class="samplenote">
+A command link button:
+</td><td class="sampleaction">
+<com:TLinkButton
+ Text="click me"
+ Command="buttonClicked"
+ CommandName="test"
+ CommandParameter="value"
+ />
+</td></tr>
+
+<tr><td class="samplenote">
+A button causing validation:
+</td><td class="sampleaction">
+<com:TTextBox ID="TextBox" />
+<com:TRequiredFieldValidator
+ ControlToValidate="TextBox"
+ Display="Dynamic"
+ ErrorMessage="input required in the textbox"
+ ValidationGroup="Group"
+ />
+<com:TLinkButton Text="submit" ValidationGroup="Group" />
+</td></tr>
+
+</table>
+
+</com:TContent> \ No newline at end of file
diff --git a/demos/quickstart/protected/pages/Controls/Samples/TLinkButton/Home.php b/demos/quickstart/protected/pages/Controls/Samples/TLinkButton/Home.php
new file mode 100644
index 00000000..f18072f2
--- /dev/null
+++ b/demos/quickstart/protected/pages/Controls/Samples/TLinkButton/Home.php
@@ -0,0 +1,14 @@
+<?php
+
+class Home extends TPage
+{
+ public function buttonClicked($sender,$param)
+ {
+ if($param instanceof TCommandEventParameter)
+ $sender->Text="Name: {$param->CommandName}, Param: {$param->CommandParameter}";
+ else
+ $sender->Text="I'm clicked";
+ }
+}
+
+?> \ No newline at end of file
diff --git a/demos/quickstart/protected/pages/Controls/Simple.page b/demos/quickstart/protected/pages/Controls/Simple.page
index 874d274c..c04e591f 100644
--- a/demos/quickstart/protected/pages/Controls/Simple.page
+++ b/demos/quickstart/protected/pages/Controls/Simple.page
@@ -49,7 +49,7 @@ Clicking on button can trigger form validation, if <tt>CausesValidation</tt>is t
<h2>TLinkButton</h2>
<p>
-<tt>TLinkButton</tt> is similar to <tt>TButton</tt> in every aspect except that <tt>TLinkButton</tt> is displayed as a hyperlink. The link text is determined by its <tt>Text</tt> property. If the <tt>Text</tt> property is empty, then the body content of the button is displayed (therefore, you can enclose a &lt;img;&gt; tag within the button body and get an image button.
+<tt>TLinkButton</tt> is similar to <tt>TButton</tt> in every aspect except that <tt>TLinkButton</tt> is displayed as a hyperlink. The link text is determined by its <tt>Text</tt> property. If the <tt>Text</tt> property is empty, then the body content of the button is displayed (therefore, you can enclose a &lt;img&gt; tag within the button body and get an image button.
</p>
<com:RunBar PagePath="Controls.Samples.TLinkButton.Home" />