diff options
Diffstat (limited to 'demos/quickstart/protected/pages/ActiveControls/Samples')
14 files changed, 281 insertions, 0 deletions
diff --git a/demos/quickstart/protected/pages/ActiveControls/Samples/TActiveDatePicker/Home.page b/demos/quickstart/protected/pages/ActiveControls/Samples/TActiveDatePicker/Home.page new file mode 100644 index 00000000..fba7ec45 --- /dev/null +++ b/demos/quickstart/protected/pages/ActiveControls/Samples/TActiveDatePicker/Home.page @@ -0,0 +1,17 @@ +<com:TContent ID="body">
+
+<h1>TActiveDatePicker Samples</h1>
+
+<table class="sampletable">
+
+<tr>
+ <td class="samplenote">Default TActiveDatePicker triggering a callback to a label</td>
+ <td class="sampleaction">
+ <com:TActiveDatePicker ID="date1" OnCallback="dateChanged"/>
+ <com:TActiveLabel ID="label1" />
+ </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/TActiveDatePicker/Home.php b/demos/quickstart/protected/pages/ActiveControls/Samples/TActiveDatePicker/Home.php new file mode 100644 index 00000000..41f8359e --- /dev/null +++ b/demos/quickstart/protected/pages/ActiveControls/Samples/TActiveDatePicker/Home.php @@ -0,0 +1,11 @@ +<?php + +class Home extends TPage +{ + public function dateChanged($sender, $param) + { + $this->label1->Text = date("r", $this->date1->TimeStamp); + } +} + +?>
\ No newline at end of file diff --git a/demos/quickstart/protected/pages/ActiveControls/Samples/TActiveFileUpload/Home.page b/demos/quickstart/protected/pages/ActiveControls/Samples/TActiveFileUpload/Home.page new file mode 100644 index 00000000..ac82e02e --- /dev/null +++ b/demos/quickstart/protected/pages/ActiveControls/Samples/TActiveFileUpload/Home.page @@ -0,0 +1,15 @@ +<com:TContent ID="body">
+
+<h1>TActiveFileUpload Sample</h1>
+
+<p>
+Please choose a file to upload:
+</p>
+
+<com:TActiveFileUpload OnFileUpload="fileUploaded" />
+
+<br/>
+
+<com:TActiveLabel ID="Result" />
+
+<div class="last-modified">$Id$</div></com:TContent>
\ No newline at end of file diff --git a/demos/quickstart/protected/pages/ActiveControls/Samples/TActiveFileUpload/Home.php b/demos/quickstart/protected/pages/ActiveControls/Samples/TActiveFileUpload/Home.php new file mode 100644 index 00000000..d5cf990a --- /dev/null +++ b/demos/quickstart/protected/pages/ActiveControls/Samples/TActiveFileUpload/Home.php @@ -0,0 +1,21 @@ +<?php
+
+class Home extends TPage
+{
+ public function fileUploaded($sender,$param)
+ {
+ if($sender->HasFile)
+ {
+ $this->Result->Text="
+ You just uploaded a file:
+ <br/>
+ Name: {$sender->FileName}
+ <br/>
+ Size: {$sender->FileSize}
+ <br/>
+ Type: {$sender->FileType}";
+ }
+ }
+}
+
+?>
\ No newline at end of file diff --git a/demos/quickstart/protected/pages/ActiveControls/Samples/TCallback/Home.page b/demos/quickstart/protected/pages/ActiveControls/Samples/TCallback/Home.page new file mode 100644 index 00000000..55ced11e --- /dev/null +++ b/demos/quickstart/protected/pages/ActiveControls/Samples/TCallback/Home.page @@ -0,0 +1,57 @@ +<com:TContent ID="body">
+
+<h1>TCallback Samples</h1>
+
+<table class="sampletable">
+
+<tr><td class="samplenote">
+An active label text being set as the result of a callback:
+</td><td class="sampleaction">
+
+<com:TCallback ID="callback1" OnCallback="callback1_Requested" />
+<script type="text/javascript">
+ function do_callback1()
+ {
+ var request = <%= $this->callback1->ActiveControl->Javascript %>;
+ request.dispatch();
+ }
+</script>
+<div onclick="do_callback1()" style="background-color:red;border: 1px solid black">Click Me!</div>
+<br/><com:TActiveLabel Text="This is a label" ID="label1"
+/>
+
+<br/><com:TActiveButton
+ Text="reset example"
+ OnClick="buttonClicked"
+/>
+</td></tr>
+
+<tr><td class="samplenote">
+A TCallback with a 3-items array as parameter.
+The first parameter is defined in the onclick() attribute of the red div;
+The second parameter is defined in the body of the javascript function;
+The third parameter is taken from the textbox;
+</td><td class="sampleaction">
+
+<com:TCallback ID="callback2" OnCallback="callback2_Requested" />
+<script type="text/javascript">
+ function do_callback2(param1)
+ {
+ var request = <%= $this->callback2->ActiveControl->Javascript %>;
+ var param2 = 'value 2';
+ var param3 = $('<%= $this->txt1->ClientID %>').value;
+ request.setCallbackParameter({'Param1':param1, 'Param2':param2, 'Param3':param3});
+ request.dispatch();
+ }
+</script>
+TextBox for third parameter: <com:TTextBox ID="txt1" text="value 3"/>
+<div onclick="do_callback2('value 1')" style="background-color:red;border: 1px solid black">Click Me!</div>
+<br/>Parameter 1 is <com:TActiveLabel Text="" ID="labelParam1" />
+<br/>Parameter 2 is <com:TActiveLabel Text="" ID="labelParam2" />
+<br/>Parameter 3 is <com:TActiveLabel Text="" ID="labelParam3" />
+</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/TCallback/Home.php b/demos/quickstart/protected/pages/ActiveControls/Samples/TCallback/Home.php new file mode 100644 index 00000000..e7f39967 --- /dev/null +++ b/demos/quickstart/protected/pages/ActiveControls/Samples/TCallback/Home.php @@ -0,0 +1,24 @@ +<?php + +class Home extends TPage +{ + public function callback1_Requested($sender,$param) + { + $this->label1->Text="You clicked the div, didn't you?"; + } + + public function buttonClicked($sender,$param) + { + $this->label1->Text="This is a label"; + } + + public function callback2_Requested($sender,$param) + { + $parameters=$param->CallbackParameter; + $this->labelParam1->Text = THttpUtility::htmlEncode($parameters->Param1); + $this->labelParam2->Text = THttpUtility::htmlEncode($parameters->Param2); + $this->labelParam3->Text = THttpUtility::htmlEncode($parameters->Param3); + } +} + +?>
\ No newline at end of file diff --git a/demos/quickstart/protected/pages/ActiveControls/Samples/TEventTriggeredCallback/Home.page b/demos/quickstart/protected/pages/ActiveControls/Samples/TEventTriggeredCallback/Home.page new file mode 100644 index 00000000..e5293f87 --- /dev/null +++ b/demos/quickstart/protected/pages/ActiveControls/Samples/TEventTriggeredCallback/Home.page @@ -0,0 +1,18 @@ +<com:TContent ID="body">
+
+<h1>TEventTriggeredCallback Samples</h1>
+
+<table class="sampletable">
+
+<tr><td class="samplenote">
+ A callback will be executed when the textbox receives and loses focus
+</td><td class="sampleaction">
+ <com:TTextBox ID="txt1" />
+ <com:TEventTriggeredCallback ControlID="txt1" EventName="focus" OnCallback="txtFocused" />
+ <com:TEventTriggeredCallback ControlID="txt1" EventName="blur" OnCallback="txtBlurred" />
+ <com:TActiveLabel ID="label1" />
+</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/TEventTriggeredCallback/Home.php b/demos/quickstart/protected/pages/ActiveControls/Samples/TEventTriggeredCallback/Home.php new file mode 100644 index 00000000..8d92e4a3 --- /dev/null +++ b/demos/quickstart/protected/pages/ActiveControls/Samples/TEventTriggeredCallback/Home.php @@ -0,0 +1,16 @@ +<?php + +class Home extends TPage +{ + public function txtFocused($sender,$param) + { + $this->label1->Text="Textbox focused"; + } + + public function txtBlurred($sender,$param) + { + $this->label1->Text="Textbox lost focus"; + } +} + +?>
\ No newline at end of file diff --git a/demos/quickstart/protected/pages/ActiveControls/Samples/TInPlaceTextBox/Home.page b/demos/quickstart/protected/pages/ActiveControls/Samples/TInPlaceTextBox/Home.page new file mode 100644 index 00000000..cd55a432 --- /dev/null +++ b/demos/quickstart/protected/pages/ActiveControls/Samples/TInPlaceTextBox/Home.page @@ -0,0 +1,17 @@ +<com:TContent ID="body">
+
+<h1>TInPlaceTextBox Samples</h1>
+
+<table class="sampletable">
+
+<tr><td class="samplenote">
+An in-place textbox text updating a label when its text changes:
+</td><td class="sampleaction">
+<com:TInPlaceTextBox ID="txt1" Text="This is an in-place textbox" OnTextChanged="textChanged" />
+<br/><com:TActiveLabel Text="This is a label" ID="label1"
+/>
+</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/TInPlaceTextBox/Home.php b/demos/quickstart/protected/pages/ActiveControls/Samples/TInPlaceTextBox/Home.php new file mode 100644 index 00000000..5c132fd6 --- /dev/null +++ b/demos/quickstart/protected/pages/ActiveControls/Samples/TInPlaceTextBox/Home.php @@ -0,0 +1,11 @@ +<?php + +class Home extends TPage +{ + public function textChanged($sender,$param) + { + $this->label1->Text=$this->txt1->Text; + } +} + +?>
\ No newline at end of file diff --git a/demos/quickstart/protected/pages/ActiveControls/Samples/TTimeTriggeredCallback/Home.page b/demos/quickstart/protected/pages/ActiveControls/Samples/TTimeTriggeredCallback/Home.page new file mode 100644 index 00000000..822be2b4 --- /dev/null +++ b/demos/quickstart/protected/pages/ActiveControls/Samples/TTimeTriggeredCallback/Home.page @@ -0,0 +1,24 @@ +<com:TContent ID="body">
+
+<h1>TTimeTriggeredCallback Samples</h1>
+
+<table class="sampletable">
+
+<tr><td class="samplenote">
+A timer updating a label with the current time every 5 seconds:
+</td><td class="sampleaction">
+<com:TTimeTriggeredCallback ID="time1" Interval="5" OnCallback="timercallback" />
+<com:TActiveButton
+ Text="start timer"
+ OnClick="startClicked"
+/>
+<com:TActiveButton
+ Text="stop timer"
+ OnClick="stopClicked"
+/>
+<com:TActiveLabel ID="label1" />
+</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/TTimeTriggeredCallback/Home.php b/demos/quickstart/protected/pages/ActiveControls/Samples/TTimeTriggeredCallback/Home.php new file mode 100644 index 00000000..6c44c8c1 --- /dev/null +++ b/demos/quickstart/protected/pages/ActiveControls/Samples/TTimeTriggeredCallback/Home.php @@ -0,0 +1,22 @@ +<?php + +class Home extends TPage +{ + public function startClicked($sender,$param) + { + $this->time1->startTimer(); + } + + public function stopClicked($sender,$param) + { + $this->time1->stopTimer(); + } + + public function timerCallback($sender,$param) + { + $this->label1->Text="Current time is ".date('H:i:s'); + } + +} + +?>
\ No newline at end of file diff --git a/demos/quickstart/protected/pages/ActiveControls/Samples/TValueTriggeredCallback/Home.page b/demos/quickstart/protected/pages/ActiveControls/Samples/TValueTriggeredCallback/Home.page new file mode 100644 index 00000000..50edf6ed --- /dev/null +++ b/demos/quickstart/protected/pages/ActiveControls/Samples/TValueTriggeredCallback/Home.page @@ -0,0 +1,17 @@ +<com:TContent ID="body">
+
+<h1>TValueTriggeredCallback Samples</h1>
+
+<table class="sampletable">
+
+<tr><td class="samplenote">
+ A callback will be executed when the textbox text changes
+</td><td class="sampleaction">
+ <com:TTextBox ID="txt1" />
+ <com:TValueTriggeredCallback ControlID="txt1" PropertyName="value" OnCallback="checkTxtValue" />
+ <com:TActiveLabel ID="label1" />
+</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/TValueTriggeredCallback/Home.php b/demos/quickstart/protected/pages/ActiveControls/Samples/TValueTriggeredCallback/Home.php new file mode 100644 index 00000000..7e2a8b20 --- /dev/null +++ b/demos/quickstart/protected/pages/ActiveControls/Samples/TValueTriggeredCallback/Home.php @@ -0,0 +1,11 @@ +<?php + +class Home extends TPage +{ + public function checkTxtValue($sender,$param) + { + $this->label1->Text=date("[H:i:s]")." Textbox changed"; + } +} + +?>
\ No newline at end of file |