summaryrefslogtreecommitdiff
path: root/demos/quickstart/protected/pages/ActiveControls/Samples/TActiveButton
diff options
context:
space:
mode:
Diffstat (limited to 'demos/quickstart/protected/pages/ActiveControls/Samples/TActiveButton')
-rw-r--r--demos/quickstart/protected/pages/ActiveControls/Samples/TActiveButton/Home.page49
-rw-r--r--demos/quickstart/protected/pages/ActiveControls/Samples/TActiveButton/Home.php20
2 files changed, 69 insertions, 0 deletions
diff --git a/demos/quickstart/protected/pages/ActiveControls/Samples/TActiveButton/Home.page b/demos/quickstart/protected/pages/ActiveControls/Samples/TActiveButton/Home.page
new file mode 100644
index 00000000..259541a2
--- /dev/null
+++ b/demos/quickstart/protected/pages/ActiveControls/Samples/TActiveButton/Home.page
@@ -0,0 +1,49 @@
+<com:TContent ID="body">
+<!-- $Id$ -->
+<h1>TActiveButton Samples (AJAX)</h1>
+
+<table class="sampletable">
+
+<tr><td class="samplenote">
+A click button with <tt>OnClick</tt> event handler:
+</td><td class="sampleaction">
+<com:TActiveButton
+ Text="click me"
+ OnClick="buttonClicked" />
+</td></tr>
+
+<tr><td class="samplenote">
+A command button with <tt>OnCallback</tt>:
+</td><td class="sampleaction">
+<com:TActiveButton
+ Text="click me"
+ OnCommand="buttonClicked"
+ CommandName="test"
+ ActiveControl.CallbackParameter="value"
+ CommandParameter="value"
+ OnCallback="buttonCallback"
+ />
+</td></tr>
+
+<tr><td class="samplenote">
+A button causing validation with <tt>OnCallback</tt>:
+</td><td class="sampleaction">
+<com:TTextBox ID="TextBox" />
+<com:TRequiredFieldValidator
+ ControlToValidate="TextBox"
+ Display="Dynamic"
+ ErrorMessage="input required in the textbox"
+ ValidationGroup="Group"
+ />
+<com:TActiveButton
+ Text="submit"
+ OnClick="buttonClicked"
+ OnCallback="buttonCallback"
+ ValidationGroup="Group" />
+</td></tr>
+
+</table>
+
+<com:TJavascriptLogger />
+
+</com:TContent> \ No newline at end of file
diff --git a/demos/quickstart/protected/pages/ActiveControls/Samples/TActiveButton/Home.php b/demos/quickstart/protected/pages/ActiveControls/Samples/TActiveButton/Home.php
new file mode 100644
index 00000000..4a4e23ca
--- /dev/null
+++ b/demos/quickstart/protected/pages/ActiveControls/Samples/TActiveButton/Home.php
@@ -0,0 +1,20 @@
+<?php
+
+// $Id$
+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";
+ }
+
+ public function buttonCallback($sender, $param)
+ {
+ $sender->Text .= ' using callback';
+ }
+}
+
+?> \ No newline at end of file