Class \Prado\Web\UI\ActiveControls\TBaseActiveCallbackControl
TBaseActiveCallbackControl is a common set of options and functionality for
active controls that can perform callback requests.
The properties of TBaseActiveCallbackControl can be accessed and changed from each individual active controls' \Prado\Web\UI\ActiveControls\getActiveControl property.
The following example sets the validation group property of a TCallback component.
<com:TCallback ActiveControl.ValidationGroup="group1" ... />
Additional client-side options and events can be set using the \Prado\Web\UI\ActiveControls\getClientSide property. The following example shows an alert box when a TCallback component response returns successfully.
<com:TCallback ActiveControl.ClientSide.OnSuccess="alert('ok!')" ... />
Class hierarchy
- \Prado\Web\UI\ActiveControls\TBaseActiveCallbackControl
- \Prado\Web\UI\ActiveControls\TBaseActiveControl
- \Prado\TComponent
Since: 3.1
public
|
|
public
|
|
public
|
|
public
|
|
public
|
getClientSide() : TCallbackClientSide
Callback client-side options can be set by setting the properties of
the ClientSide property. E.g. <com:TCallback ActiveControl.ClientSide.OnSuccess="..." />
See {@see \Prado\Web\UI\ActiveControls\TCallbackClientSide} for details on the properties of ClientSide.
|
public
|
getJavascript() : string
Returns the javascript callback request instance. To invoke a callback
request for this control call the <tt>dispatch()</tt> method on the
request instance. Example code in javascript
```js
var request = <%= $this->mycallback->ActiveControl->Javascript %>;
request.setParameter('hello');
request.dispatch(); //make the callback request.
|
public
|
|
public
|
|
public
|
registerCallbackClientScript(string $class[, null|array<string|int, mixed> $options = null ]) : mixed
Registers the callback control javascript code. Client-side options are
merged and passed to the javascript code. This method should be called by
Active component developers wanting to register the javascript to initialize
the active component with additional options offered by the
{@see getClientSide ClientSide} property.
|
public
|
setCallbackOptions(string $value) : mixed
Sets default callback options. Takes the ID of a TCallbackOptions
component to duplicate the client-side
options for this control. The {@see getClientSide ClientSide}
subproperties takes precedence over the CallbackOptions property.
|
public
|
|
public
|
|
public
|
setClientSide(TCallbackClientSide $client) : mixed
Sets the client side options. Can only be set when client side is null.
|
public
|
|
protected
|
|
protected
|
|
protected
|
getDefaultClientSideOptions() : array<string|int, mixed>
Returns an array of default callback client-side options. The default options
are obtained from the client-side options of a TCallbackOptions control with
ID specified by {@see setCallbackOptions CallbackOptions}.
|
\Prado\TComponent::GLOBAL_RAISE_EVENT_LISTENER |