Class \Prado\Web\UI\ActiveControls\TCallback
TCallback component class.
The TCallback provides a basic callback handler that can be invoked from the client side by running the javascript code obtained from the \Prado\Web\UI\ActiveControls\TBaseActiveCallbackControl::getJavascript property. The event \Prado\Web\UI\ActiveControls\onCallback is raised when a callback is requested made.
Example usage:
<com:TCallback ID="callback1" OnCallback="callback1_Requested" />
<script>
function do_callback1()
{
var request = <%= $this->callback1->ActiveControl->Javascript %>;
request.dispatch();
}
</script>
<div onclick="do_callback1()">Click Me!</div>
Class hierarchy
- \Prado\Web\UI\ActiveControls\TCallback implements IActiveControl, ICallbackEventHandler
- \Prado\Web\UI\TControl implements IRenderable, IBindable
- \Prado\TApplicationComponent
- \Prado\TComponent
Since: 3.1
public
|
__construct() : mixed
Creates a new callback control, sets the adapter to
TActiveControlAdapter. If you override this class, be sure to set the
adapter appropriately by, for example, call this constructor.
|
public
|
|
public
|
|
public
|
onCallback(TCallbackEventParameter $param) : mixed
This method is invoked when a callback is requested. The method raises
'OnCallback' event to fire up the event handlers. If you override this
method, be sure to call the parent implementation so that the event
handler can be invoked.
|
public
|
raiseCallbackEvent(TCallbackEventParameter $param) : mixed
Raises the callback event. This method is required by
{@see ICallbackEventHandler ICallbackEventHandler} interface. If
{@see getCausesValidation ActiveControl.CausesValidation} is true,
it will invoke the page's {@see \Prado\Web\UI\TPage::validate validate} method first.
It will raise \Prado\Web\UI\ActiveControls\onCallback event. This method is mainly used by framework and control developers. |