Template file: Home.page
Class file: Home.php

/ActiveControls/Samples/TActiveListBox/Home.page

<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>

<h2>List Boxes in Multiple Selection Mode</h2>
<i>Use Ctrl + Mouse Click to change selection</i>
<br/>

<table class="sampletable">

<tr>
<td class="samplenote">
Multiple items can be selected together:
  </td>
  <td class="sampleaction">
    <com:TActiveListBox
    	ID="MDropdownList"
    	SelectionMode="Multiple"
    	OnSelectedIndexChanged="multiSelectionChanged"
	>
  <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:TActiveLabel ID="MSelectionResult" ForeColor="red" />
  </td>
</tr>

</table>
</com:TContent>