From 3490b6226263b05d980d040a8fbf933c23979ab6 Mon Sep 17 00:00:00 2001 From: "ctrlaltca@gmail.com" <> Date: Thu, 2 Jun 2011 17:44:51 +0000 Subject: documentation updates: TCallback, TEventTriggeredCallback, TValueTriggeredCallback, TTimeTriggeredCallback --- .../protected/pages/ActiveControls/Callback.page | 34 ++++++++++ .../ActiveControls/EventTriggeredCallback.page | 15 +++++ .../protected/pages/ActiveControls/Home.page | 78 ++++++++++++++++------ .../ActiveControls/Samples/TCallback/Home.page | 57 ++++++++++++++++ .../ActiveControls/Samples/TCallback/Home.php | 24 +++++++ .../Samples/TEventTriggeredCallback/Home.page | 18 +++++ .../Samples/TEventTriggeredCallback/Home.php | 16 +++++ .../Samples/TTimeTriggeredCallback/Home.page | 24 +++++++ .../Samples/TTimeTriggeredCallback/Home.php | 22 ++++++ .../Samples/TValueTriggeredCallback/Home.page | 17 +++++ .../Samples/TValueTriggeredCallback/Home.php | 11 +++ .../ActiveControls/TimeTriggeredCallback.page | 16 +++++ .../ActiveControls/ValueTriggeredCallback.page | 18 +++++ 13 files changed, 328 insertions(+), 22 deletions(-) create mode 100644 demos/quickstart/protected/pages/ActiveControls/Callback.page create mode 100644 demos/quickstart/protected/pages/ActiveControls/EventTriggeredCallback.page create mode 100644 demos/quickstart/protected/pages/ActiveControls/Samples/TCallback/Home.page create mode 100644 demos/quickstart/protected/pages/ActiveControls/Samples/TCallback/Home.php create mode 100644 demos/quickstart/protected/pages/ActiveControls/Samples/TEventTriggeredCallback/Home.page create mode 100644 demos/quickstart/protected/pages/ActiveControls/Samples/TEventTriggeredCallback/Home.php create mode 100644 demos/quickstart/protected/pages/ActiveControls/Samples/TTimeTriggeredCallback/Home.page create mode 100644 demos/quickstart/protected/pages/ActiveControls/Samples/TTimeTriggeredCallback/Home.php create mode 100644 demos/quickstart/protected/pages/ActiveControls/Samples/TValueTriggeredCallback/Home.page create mode 100644 demos/quickstart/protected/pages/ActiveControls/Samples/TValueTriggeredCallback/Home.php create mode 100644 demos/quickstart/protected/pages/ActiveControls/TimeTriggeredCallback.page create mode 100644 demos/quickstart/protected/pages/ActiveControls/ValueTriggeredCallback.page (limited to 'demos/quickstart/protected') diff --git a/demos/quickstart/protected/pages/ActiveControls/Callback.page b/demos/quickstart/protected/pages/ActiveControls/Callback.page new file mode 100644 index 00000000..d37eb614 --- /dev/null +++ b/demos/quickstart/protected/pages/ActiveControls/Callback.page @@ -0,0 +1,34 @@ + + +

TCallback

+ + +

+TCallback provides a basic callback handler that can be invoked from the +client side by using the javascript ojbect obtained from the +ActiveControl.Javascript property. +You can set the CallbackParameter property from javascript directly on +the object returned by ActiveControl.Javascript. +Once you are ready, you can call the dispatch() method on the object to +execute the callback. +The server-side event OnCallback is raised when a callback is requested made. +

+ +

+Example usage: +

+ +<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()">Click Me!</div> + + + + +
$Id$
\ No newline at end of file diff --git a/demos/quickstart/protected/pages/ActiveControls/EventTriggeredCallback.page b/demos/quickstart/protected/pages/ActiveControls/EventTriggeredCallback.page new file mode 100644 index 00000000..170fa295 --- /dev/null +++ b/demos/quickstart/protected/pages/ActiveControls/EventTriggeredCallback.page @@ -0,0 +1,15 @@ + + +

TEventTriggeredCallback

+ + +

+TEventTriggeredCallback triggers a new callback request when a particular EventName +on a control with ID given by ControlID is raised. +The default action of the event on the client-side can be prevented when +PreventDefaultAction is set to true. +

+ + + +
$Id$
\ 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 7834cc1d..bb74c4bf 100644 --- a/demos/quickstart/protected/pages/ActiveControls/Home.page +++ b/demos/quickstart/protected/pages/ActiveControls/Home.page @@ -159,12 +159,12 @@ TActiveButton control. See also the later part of the TCallback + TCallback a generic control that can perform callback requests.
  • - * TEventTriggeredCallback + TEventTriggeredCallback triggers a callback request based on HTML DOM events.
  • @@ -174,12 +174,12 @@ TActiveButton control. See also the later part of the TTimeTriggeredCallback + TTimeTriggeredCallback triggers a callback request based on time elapsed.
  • - * TValueTriggeredCallback + TValueTriggeredCallback monitors (using a timer) an attribute of an HTML element and triggers a callback request when the attribute value changes.
  • @@ -355,32 +355,72 @@ if Javascript was disabled on the client's browser.

    -

    Active Control Infrastructure Classes

    +

    Active Control Basic Infrastructure Classes

    The following classes provide the basic infrastructure classes required to -realize the active controls.

    +realize the active controls. They can be useful to develop new active controls, but Prado users tipically don't need +to use them.

    + +

    Active Control Infrastructure Advanced Classes

    +

    The following classes provide advanced properties and events needed to realize the active controls. +A Prado user can use them to customize active controls behaviour and interact directly with the client side during a callback. +

    +
    $Id$
    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 @@ + + +

    TCallback Samples

    + + + + + + + + +
    +An active label text being set as the result of a callback: + + + + +
    Click Me!
    +
    + +
    +
    +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; + + + + +TextBox for third parameter: +
    Click Me!
    +
    Parameter 1 is +
    Parameter 2 is +
    Parameter 3 is +
    + +
    $Id$
    \ 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 @@ +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 @@ + + +

    TEventTriggeredCallback Samples

    + + + + + +
    + A callback will be executed when the textbox receives and loses focus + + + + + +
    + +
    $Id$
    \ 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 @@ +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/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 @@ + + +

    TTimeTriggeredCallback Samples

    + + + + + +
    +A timer updating a label with the current time every 5 seconds: + + + + + +
    + +
    $Id$
    \ 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 @@ +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 @@ + + +

    TValueTriggeredCallback Samples

    + + + + + +
    + A callback will be executed when the textbox text changes + + + + +
    + +
    $Id$
    \ 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 @@ +label1->Text=date("[H:i:s]")." Textbox changed"; + } +} + +?> \ No newline at end of file diff --git a/demos/quickstart/protected/pages/ActiveControls/TimeTriggeredCallback.page b/demos/quickstart/protected/pages/ActiveControls/TimeTriggeredCallback.page new file mode 100644 index 00000000..3239f931 --- /dev/null +++ b/demos/quickstart/protected/pages/ActiveControls/TimeTriggeredCallback.page @@ -0,0 +1,16 @@ + + +

    TTimeTriggeredCallback

    + + +

    +TTimeTriggeredCallback sends callback request every Interval seconds. +Upon each callback request, the OnCallback event is raised. +The timer can be started by calling startTimer() and stopped using +stopTimer(). The timer can be automatically started when +StartTimerOnLoad is true. +

    + + + +
    $Id$
    \ No newline at end of file diff --git a/demos/quickstart/protected/pages/ActiveControls/ValueTriggeredCallback.page b/demos/quickstart/protected/pages/ActiveControls/ValueTriggeredCallback.page new file mode 100644 index 00000000..c05d6a20 --- /dev/null +++ b/demos/quickstart/protected/pages/ActiveControls/ValueTriggeredCallback.page @@ -0,0 +1,18 @@ + + +

    TValueTriggeredCallback

    + + +

    +TValueTriggeredCallback observes the value with PropertyName of a +control with ControlID. Changes to the observed +property value will trigger a new callback request. The property value is checked +for changes every Interval seconds. +A DecayRate can be set to increase the polling +interval linearly if no changes are observed. Once a change is +observed, the polling interval is reset to the original value. +

    + + + +
    $Id$
    \ No newline at end of file -- cgit v1.2.3