diff options
author | ctrlaltca@gmail.com <> | 2011-06-02 11:16:04 +0000 |
---|---|---|
committer | ctrlaltca@gmail.com <> | 2011-06-02 11:16:04 +0000 |
commit | ffc9318788952a879815cfa01a8b17b7ddae89b1 (patch) | |
tree | 2617fc3a77ca6372f0c6cb3d0775c4007b6208b9 /demos/quickstart/protected/pages/ActiveControls | |
parent | 8aa0d56705a71894a80c1293730b6c67cddc8a40 (diff) |
added documentation and examples for TActiveCheckBoxList, TActiveDropDownList, TActiveListBox, TActiveRadioButtonList classes
Diffstat (limited to 'demos/quickstart/protected/pages/ActiveControls')
13 files changed, 648 insertions, 4 deletions
diff --git a/demos/quickstart/protected/pages/ActiveControls/ActiveCheckBoxList.page b/demos/quickstart/protected/pages/ActiveControls/ActiveCheckBoxList.page new file mode 100644 index 00000000..2560ece5 --- /dev/null +++ b/demos/quickstart/protected/pages/ActiveControls/ActiveCheckBoxList.page @@ -0,0 +1,32 @@ +<com:TContent ID="body" >
+
+<h1>TActiveCheckBoxList</h1>
+<com:DocLink ClassPath="System.Web.UI.ActiveControls.TActiveCheckBoxList" />
+
+<p class="block-content">
+<tt>TActiveCheckBoxList</tt> is the active counterpart to the original <tt>TCheckBoxList</tt> control.
+</p>
+
+<p class="block-content">
+The <tt>AutoPostBack</tt> property is set to true by default.
+Thus, when a checkbox is clicked a <tt>OnCallback</tt> event is
+raised after <tt>OnSelectedIndexChanged</tt> event.
+</p>
+
+<p class="block-content">
+With <tt>ActiveControl.EnabledUpdate</tt>
+set to true (default is true), changes to the selection will be updated
+on the client side.
+</p>
+
+<p class="block-content">
+List items can <b>not</b> be changed dynamically during a callback request.
+</p>
+
+<p class="block-content">
+Please refer to the original documentation of <a href="?page=Controls.List">TCheckBoxList</a> for usage.
+</p>
+
+<com:RunBar PagePath="ActiveControls.Samples.TActiveCheckBoxList.Home" />
+
+<div class="last-modified">$Id$</div></com:TContent>
\ No newline at end of file diff --git a/demos/quickstart/protected/pages/ActiveControls/ActiveDropDownList.page b/demos/quickstart/protected/pages/ActiveControls/ActiveDropDownList.page new file mode 100644 index 00000000..4400c552 --- /dev/null +++ b/demos/quickstart/protected/pages/ActiveControls/ActiveDropDownList.page @@ -0,0 +1,32 @@ +<com:TContent ID="body" >
+
+<h1>TActiveDropDownList</h1>
+<com:DocLink ClassPath="System.Web.UI.ActiveControls.TActiveDropDownList" />
+
+<p class="block-content">
+<tt>TActiveDropDownList</tt> is the active counterpart to the original <tt>TDropDownList</tt> control.
+</p>
+
+<p class="block-content">
+The <tt>AutoPostBack</tt> property is set to true by default.
+Thus, when the drop down list selection is changed the <tt>OnCallback</tt> event is
+raised after <tt>OnSelectedIndexChanged</tt> event.
+</p>
+
+<p class="block-content">
+With <tt>ActiveControl.EnabledUpdate</tt>
+set to true (default is true), changes to the selection, <b>after</b> OnLoad event has
+been raised, will be updated on the client side.
+</p>
+
+<p class="block-content">
+List items can be changed dynamically during a callback request.
+</p>
+
+<p class="block-content">
+Please refer to the original documentation of <a href="?page=Controls.List">TDropDownList</a> for usage.
+</p>
+
+<com:RunBar PagePath="ActiveControls.Samples.TActiveDropDownList.Home" />
+
+<div class="last-modified">$Id$</div></com:TContent>
\ No newline at end of file diff --git a/demos/quickstart/protected/pages/ActiveControls/ActiveListBox.page b/demos/quickstart/protected/pages/ActiveControls/ActiveListBox.page new file mode 100644 index 00000000..802c9fb1 --- /dev/null +++ b/demos/quickstart/protected/pages/ActiveControls/ActiveListBox.page @@ -0,0 +1,28 @@ +<com:TContent ID="body" >
+
+<h1>TActiveListBox</h1>
+<com:DocLink ClassPath="System.Web.UI.ActiveControls.TActiveListBox" />
+
+<p class="block-content">
+<tt>TActiveListBox</tt> is the active counterpart to the original <tt>TListBox</tt> control.
+</p>
+
+<p class="block-content">
+The <tt>AutoPostBack</tt> property is set to true by default.
+Thus, when a list item is clicked a <tt>OnCallback</tt> event is
+raised after <tt>OnSelectedIndexChanged</tt> event.
+</p>
+
+<p class="block-content">
+With <tt>ActiveControl.EnabledUpdate</tt>
+set to true (default is true), changes to the selection will be updated
+on the client side.
+</p>
+
+<p class="block-content">
+Please refer to the original documentation of <a href="?page=Controls.List">TListBox</a> for usage.
+</p>
+
+<com:RunBar PagePath="ActiveControls.Samples.TActiveListBox.Home" />
+
+<div class="last-modified">$Id$</div></com:TContent>
\ No newline at end of file diff --git a/demos/quickstart/protected/pages/ActiveControls/ActiveRadioButtonList.page b/demos/quickstart/protected/pages/ActiveControls/ActiveRadioButtonList.page new file mode 100644 index 00000000..6095a9d3 --- /dev/null +++ b/demos/quickstart/protected/pages/ActiveControls/ActiveRadioButtonList.page @@ -0,0 +1,32 @@ +<com:TContent ID="body" >
+
+<h1>TActiveRadioButtonList</h1>
+<com:DocLink ClassPath="System.Web.UI.ActiveControls.TActiveRadioButtonList" />
+
+<p class="block-content">
+<tt>TActiveRadioButtonList</tt> is the active counterpart to the original <tt>TRadioButtonList</tt> control.
+</p>
+
+<p class="block-content">
+The <tt>AutoPostBack</tt> property is set to true by default.
+Thus, when a radio button is clicked a <tt>OnCallback</tt> event is
+raised after <tt>OnSelectedIndexChanged</tt> event.
+</p>
+
+<p class="block-content">
+With <tt>ActiveControl.EnabledUpdate</tt>
+set to true (default is true), changes to the selection will be updated
+on the client side.
+</p>
+
+<p class="block-content">
+List items can <b>not</b> be changed dynamically during a callback request.
+</p>
+
+<p class="block-content">
+Please refer to the original documentation of <a href="?page=Controls.List">TRadioButtonList</a> for usage.
+</p>
+
+<com:RunBar PagePath="ActiveControls.Samples.TActiveRadioButtonList.Home" />
+
+<div class="last-modified">$Id$</div></com:TContent>
\ No newline at end of file diff --git a/demos/quickstart/protected/pages/ActiveControls/Home.page b/demos/quickstart/protected/pages/ActiveControls/Home.page index 798bc267..a658aa16 100644 --- a/demos/quickstart/protected/pages/ActiveControls/Home.page +++ b/demos/quickstart/protected/pages/ActiveControls/Home.page @@ -107,26 +107,26 @@ TActiveButton</a> control. See also the later part of the <a href="?page=Tutoria <h2 id="128033">Active List Controls</h2>
<ul id="u2" class="block-content">
<li>
- * <a href="?page=ActiveControls.ActiveCheckBoxList">TActiveCheckBoxList</a>
+ <a href="?page=ActiveControls.ActiveCheckBoxList">TActiveCheckBoxList</a>
displays a list of checkboxes on a Web page and each checkbox
can trigger a callback request.
</li>
<li>
- * <a href="?page=ActiveControls.ActiveDropDownList">TActiveDropDownList</a>
+ <a href="?page=ActiveControls.ActiveDropDownList">TActiveDropDownList</a>
displays a dropdown list box that allows users to select a
single option from a few prespecified ones. It can be used
to perform a callback request.
</li>
<li>
- * <a href="?page=ActiveControls.ActiveListBox">TActiveListBox</a>
+ <a href="?page=ActiveControls.ActiveListBox">TActiveListBox</a>
displays a list box that allows single or multiple selection. It can be used
to perform a callback request.
</li>
<li>
- * <a href="?page=ActiveControls.ActiveRadioButtonList">TActiveRadioButtonList</a>
+ <a href="?page=ActiveControls.ActiveRadioButtonList">TActiveRadioButtonList</a>
is similar to TActiveCheckBoxList in every aspect except that each
TActiveRadioButtonList displays a group of radiobuttons. Each radio button
can perform a callback request.
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 @@ +<com:TContent ID="body">
+
+<h1>TActiveCheckBoxList Samples</h1>
+
+<table class="sampletable">
+
+<tr>
+<td class="samplenote">
+Check box list with default settings:
+</td>
+<td class="sampleaction">
+<com:TActiveCheckBoxList>
+ <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:TActiveCheckBoxList>
+</td>
+</tr>
+
+<tr>
+<td class="samplenote">
+Check box list's behavior upon callback:
+</td>
+<td class="sampleaction">
+<com:TActiveCheckBoxList ID="CheckBoxList" OnCallback="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" Enabled="false" />
+ <com:TListItem Value="value 5" Text="item 5" Selected="true" />
+</com:TActiveCheckBoxList>
+<br/>
+<com:TActiveLabel ID="SelectionResult" ForeColor="red" />
+</td>
+</tr>
+
+</table>
+
+
+<h2>CheckBox List with Validation</h2>
+
+<table class="sampletable">
+
+<tr>
+<td class="samplenote">
+CheckBox list causing validation:
+</td>
+<td class="sampleaction">
+<com:TTextBox ID="TextBox" />
+<com:TRequiredFieldValidator
+ ControlToValidate="TextBox"
+ ErrorMessage="You must enter a value"
+ Display="Dynamic"
+ ValidationGroup="Group2"
+ />
+<com:TActiveCheckBoxList ValidationGroup="Group2">
+ <com:TListItem Text="Agree" />
+ <com:TListItem Text="Disagree" />
+</com:TActiveCheckBoxList>
+</td>
+</tr>
+
+</table>
+
+<div class="last-modified">$Id$</div></com:TContent>
\ 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 @@ +<?php
+
+class Home extends TPage
+{
+ 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($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 @@ +<com:TContent ID="body">
+
+<h1>TActiveDropDownList Samples</h1>
+
+<table class="sampletable">
+
+<tr>
+<td class="samplenote">
+Callback dropdown list:
+</td>
+<td class="sampleaction">
+<com:TActiveDropDownList
+ OnSelectedIndexChanged="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:TActiveDropDownList>
+<com:TActiveLabel ID="SelectionResult" ForeColor="red" />
+</td>
+</tr>
+
+</table>
+
+
+<h2>Changing items to DropDown Lists on callback</h2>
+
+<table class="sampletable">
+
+<tr>
+<td class="samplenote">
+Adding an item on every callback:
+ </td>
+ <td class="sampleaction">
+ <com:TActiveDropDownList ID="ddl1" />
+ <com:TActiveButton ID="button1" Text="add a new item" OnCallback="buttonClicked" />
+ <com:TActiveLabel ID="label1" ForeColor="red" />
+ </td>
+</tr>
+
+</table>
+
+<table class="sampletable">
+
+<tr>
+<td class="samplenote">
+Clearing / restoring the dropdownlist on callback:
+ </td>
+ <td class="sampleaction">
+ <com:TActiveDropDownList ID="ddl2" />
+ <com:TActiveButton ID="button2" Text="clear" OnCallback="clearClicked" />
+ <com:TActiveButton ID="button3" Text="reset" OnCallback="resetClicked" />
+ <com:TActiveLabel ID="label2" ForeColor="red" />
+ </td>
+</tr>
+
+</table>
+
+<h2>List Boxes with Validation</h2>
+
+<table class="sampletable">
+
+<tr>
+<td class="samplenote">
+Dropdown list is being validated:
+</td>
+<td class="sampleaction">
+<com:TActiveDropDownList ID="VDropDownList1">
+ <com:TListItem Value="value 1" Text="item 1" />
+ <com:TListItem Value="value 2" Text="item 2" />
+ <com:TListItem Value="value 3" Text="item 3" />
+ <com:TListItem Value="value 4" Text="item 4" />
+</com:TActiveDropDownList>
+<com:TRequiredFieldValidator
+ ControlToValidate="VDropDownList1"
+ ErrorMessage="You must make a selection other than the first option"
+ InitialValue="value 1"
+ Display="Dynamic"
+ ValidationGroup="Group1"
+ />
+<com:TActiveButton Text="Submit" ValidationGroup="Group1" />
+</td>
+</tr>
+
+<tr>
+<td class="samplenote">
+Dropdown list causing validation:
+</td>
+<td class="sampleaction">
+<com:TTextBox ID="TextBox" />
+<com:TRequiredFieldValidator
+ ControlToValidate="TextBox"
+ ErrorMessage="You must enter a value"
+ Display="Dynamic"
+ ValidationGroup="Group2"
+ />
+<com:TActiveDropDownList
+ ID="VDropDownList2"
+ ValidationGroup="Group2">
+ <com:TListItem Text="Agree" />
+ <com:TListItem Text="Disagree" />
+</com:TActiveDropDownList>
+</td>
+</tr>
+
+</table>
+
+<div class="last-modified">$Id$</div></com:TContent>
\ 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 @@ +<?php
+
+class Home extends TPage
+{
+ public function onLoad($param)
+ {
+ parent::onLoad($param);
+ if(!$this->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 @@ +<com:TContent ID="body">
+
+<h1>TActiveListBox Samples</h1>
+
+<table class="sampletable">
+
+<tr>
+<td class="samplenote">
+Callback listbox:
+</td>
+<td class="sampleaction">
+<com:TActiveListBox
+ OnSelectedIndexChanged="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:TActiveListBox>
+<com:TActiveLabel ID="SelectionResult" ForeColor="red" />
+</td>
+</tr>
+
+</table>
+
+
+<h2>Changing items to a Listbox on callback</h2>
+
+<table class="sampletable">
+
+<tr>
+<td class="samplenote">
+Adding an item on every callback:
+ </td>
+ <td class="sampleaction">
+ <com:TActiveListBox ID="box1" />
+ <com:TActiveButton ID="button1" Text="add a new item" OnCallback="buttonClicked" />
+ <com:TActiveLabel ID="label1" ForeColor="red" />
+ </td>
+</tr>
+
+</table>
+
+<table class="sampletable">
+
+<tr>
+<td class="samplenote">
+Clearing / restoring the listbox on callback:
+ </td>
+ <td class="sampleaction">
+ <com:TActiveListBox ID="box2" />
+ <com:TActiveButton ID="button2" Text="clear" OnCallback="clearClicked" />
+ <com:TActiveButton ID="button3" Text="reset" OnCallback="resetClicked" />
+ <com:TActiveLabel ID="label2" ForeColor="red" />
+ </td>
+</tr>
+
+</table>
+
+<h2>List Boxes with Validation</h2>
+
+<table class="sampletable">
+
+<tr>
+<td class="samplenote">
+Listbox is being validated:
+</td>
+<td class="sampleaction">
+<com:TActiveListBox ID="VDropDownList1">
+ <com:TListItem Value="value 1" Text="item 1" />
+ <com:TListItem Value="value 2" Text="item 2" />
+ <com:TListItem Value="value 3" Text="item 3" />
+ <com:TListItem Value="value 4" Text="item 4" />
+</com:TActiveListBox>
+<com:TRequiredFieldValidator
+ ControlToValidate="VDropDownList1"
+ ErrorMessage="You must make a selection other than the first option"
+ InitialValue="value 1"
+ Display="Dynamic"
+ ValidationGroup="Group1"
+ />
+<com:TActiveButton Text="Submit" ValidationGroup="Group1" />
+</td>
+</tr>
+
+<tr>
+<td class="samplenote">
+Listbox causing validation:
+</td>
+<td class="sampleaction">
+<com:TTextBox ID="TextBox" />
+<com:TRequiredFieldValidator
+ ControlToValidate="TextBox"
+ ErrorMessage="You must enter a value"
+ Display="Dynamic"
+ ValidationGroup="Group2"
+ />
+<com:TActiveListBox
+ ID="VDropDownList2"
+ ValidationGroup="Group2">
+ <com:TListItem Text="Agree" />
+ <com:TListItem Text="Disagree" />
+</com:TActiveListBox>
+</td>
+</tr>
+
+</table>
+
+<div class="last-modified">$Id$</div></com:TContent>
\ 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 @@ +<?php
+
+class Home extends TPage
+{
+ public function onLoad($param)
+ {
+ parent::onLoad($param);
+ if(!$this->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 @@ +<com:TContent ID="body">
+
+<h1>TActiveRadioButtonList Samples</h1>
+
+<table class="sampletable">
+
+<tr>
+<td class="samplenote">
+Check box list with default settings:
+</td>
+<td class="sampleaction">
+<com:TActiveRadioButtonList>
+ <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:TActiveRadioButtonList>
+</td>
+</tr>
+
+<tr>
+<td class="samplenote">
+Check box list's behavior upon callback:
+</td>
+<td class="sampleaction">
+<com:TActiveRadioButtonList ID="RadioButtonList" OnCallback="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" Enabled="false" />
+ <com:TListItem Value="value 5" Text="item 5" Selected="true" />
+</com:TActiveRadioButtonList>
+<br/>
+<com:TActiveLabel ID="SelectionResult" ForeColor="red" />
+</td>
+</tr>
+
+</table>
+
+
+<h2>RadioButton List with Validation</h2>
+
+<table class="sampletable">
+
+<tr>
+<td class="samplenote">
+RadioButton list causing validation:
+</td>
+<td class="sampleaction">
+<com:TTextBox ID="TextBox" />
+<com:TRequiredFieldValidator
+ ControlToValidate="TextBox"
+ ErrorMessage="You must enter a value"
+ Display="Dynamic"
+ ValidationGroup="Group2"
+ />
+<com:TActiveRadioButtonList ValidationGroup="Group2">
+ <com:TListItem Text="Agree" />
+ <com:TListItem Text="Disagree" />
+</com:TActiveRadioButtonList>
+</td>
+</tr>
+
+</table>
+
+<div class="last-modified">$Id$</div></com:TContent>
\ 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 @@ +<?php
+
+class Home extends TPage
+{
+ 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($this->RadioButtonList,$this->SelectionResult);
+ }
+}
+
+?>
\ No newline at end of file |