summaryrefslogtreecommitdiff
path: root/demos
diff options
context:
space:
mode:
authorxue <>2006-01-24 05:13:51 +0000
committerxue <>2006-01-24 05:13:51 +0000
commit85a8e37118107312b971aba4065be4e850441866 (patch)
tree5b8a320a42dbca31718bf537a00bd0159a1fcdee /demos
parent230067c5425f9e95e601d682a8b9bb523190856e (diff)
Added TRadioButton demo and FT.
Diffstat (limited to 'demos')
-rw-r--r--demos/quickstart/protected/pages/Controls/Samples/TRadioButton/Home.page102
-rw-r--r--demos/quickstart/protected/pages/Controls/Samples/TRadioButton/Home.php27
2 files changed, 129 insertions, 0 deletions
diff --git a/demos/quickstart/protected/pages/Controls/Samples/TRadioButton/Home.page b/demos/quickstart/protected/pages/Controls/Samples/TRadioButton/Home.page
new file mode 100644
index 00000000..4cda20d8
--- /dev/null
+++ b/demos/quickstart/protected/pages/Controls/Samples/TRadioButton/Home.page
@@ -0,0 +1,102 @@
+<com:TContent ID="body">
+
+<h1>TRadioButton Samples</h1>
+
+<table class="sampletable">
+
+<tr><td class="samplenote">
+A radiobutton with customized text alignment, color and font:
+</td><td class="sampleaction">
+<com:TRadioButton
+ Text="radiobutton"
+ TextAlign="Left"
+ ForeColor="silver"
+ BackColor="green"
+ Font.Size="14pt"
+/>
+</td></tr>
+
+<tr><td class="samplenote">
+A radiobutton with label and input attributes:
+</td><td class="sampleaction">
+<com:TRadioButton
+ Text="click me"
+ InputAttributes.value="value"
+ LabelAttributes.style="color:red"
+/>
+</td></tr>
+
+<tr><td class="samplenote">
+An auto postback radiobutton:
+</td><td class="sampleaction">
+<com:TRadioButton
+ AutoPostBack="true"
+ Text="click me"
+ OnCheckedChanged="radiobuttonClicked"
+ />
+</td></tr>
+
+<tr><td class="samplenote">
+A radiobutton causing validation on a textbox:
+</td><td class="sampleaction">
+<com:TTextBox ID="TextBox" />
+<com:TRequiredFieldValidator
+ ControlToValidate="TextBox"
+ Display="Dynamic"
+ ErrorMessage="input required in the textbox"
+ ValidationGroup="Group"
+ />
+<com:TRadioButton
+ Text="submit"
+ AutoPostBack="true"
+ ValidationGroup="Group"
+ />
+</td></tr>
+
+<tr><td class="samplenote">
+A radiobutton validated by a required field validator:
+</td><td class="sampleaction">
+<com:TRadioButton
+ ID="RadioButton"
+ Text="Consent"
+ ValidationGroup="Group2"
+ />
+<com:TButton Text="Submit" ValidationGroup="Group2" />
+<com:TRequiredFieldValidator
+ ControlToValidate="RadioButton"
+ Display="Dynamic"
+ ErrorMessage="You must consent."
+ ValidationGroup="Group2"
+ />
+</td></tr>
+
+<tr><td class="samplenote">
+A radiobutton group:
+</td><td class="sampleaction">
+<com:TRadioButton
+ ID="Radio1"
+ GroupName="RadioGroup"
+ Text="Option 1"
+ />
+<com:TRadioButton
+ ID="Radio2"
+ GroupName="RadioGroup"
+ Text="Option 2"
+ />
+<com:TRadioButton
+ ID="Radio3"
+ GroupName="RadioGroup"
+ Text="Option 3"
+ />
+<com:TRadioButton
+ ID="Radio4"
+ Text="Option 4 (in a different group)"
+ />
+<br/>
+<com:TButton Text="Submit" OnClick="selectRadioButton" />
+<com:TLabel ID="Result" />
+</td></tr>
+
+</table>
+
+</com:TContent> \ No newline at end of file
diff --git a/demos/quickstart/protected/pages/Controls/Samples/TRadioButton/Home.php b/demos/quickstart/protected/pages/Controls/Samples/TRadioButton/Home.php
new file mode 100644
index 00000000..034d2fcc
--- /dev/null
+++ b/demos/quickstart/protected/pages/Controls/Samples/TRadioButton/Home.php
@@ -0,0 +1,27 @@
+<?php
+
+class Home extends TPage
+{
+ public function radiobuttonClicked($sender,$param)
+ {
+ $sender->Text="I'm clicked";
+ }
+
+ public function selectRadioButton($sender,$param)
+ {
+ $selection='';
+ if($this->Radio1->Checked)
+ $selection.='1';
+ if($this->Radio2->Checked)
+ $selection.='2';
+ if($this->Radio3->Checked)
+ $selection.='3';
+ if($this->Radio4->Checked)
+ $selection.='4';
+ if($selection==='')
+ $selection='empty';
+ $this->Result->Text='Your selection is '.$selection;
+ }
+}
+
+?> \ No newline at end of file