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' getActiveControl property.
The following example to set the validation group property of a TCallback component.
- <com:TCallback ActiveControl.ValidationGroup="group1" ... />
Additional client-side options and events can be set using the ClientSide property. The following example to show an alert box when a TCallback component response returns successfully.
- <com:TCallback Active.Control.ClientSide.OnSuccess="alert('ok!')" ... />
Method Summary |
boolean
|
|
protected
TCallbackClientSide
|
|
string
|
|
mixed
|
|
boolean
|
|
TCallbackClientSide
|
Callback client-side options can be set by setting the properties of the ClientSide property. E.g. <com:TCallback ActiveControl.ClientSide.OnSuccess="..." /> See TCallbackClientSide for details on the properties of ClientSide.
|
protected
array
|
|
protected
array
|
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 setCallbackOptionsID.
|
string
|
Returns the javascript callback request instance. To invoke a callback
|
void
|
|
string
|
|
void
|
Registers the callback control javascript code. Client-side options are
|
void
|
Sets default callback options. Takes the ID of a TCallbackOptions component to duplicate the client-side options for this control. The getClientSide subproperties has precendent over the CallbackOptions property.
|
void
|
|
void
|
|
void
|
Sets the client side options. Can only be set when client side is null.
|
void
|
|
Method Details |
canCauseValidation
public boolean canCauseValidation |
() |
Output |
boolean
| whether to perform validation if the callback is requested. |
Exception |
|
createClientSide
|
getCallbackOptions
public string getCallbackOptions |
() |
Output |
string
| ID of a TCallbackOptions control from which ClientSide options are duplicated. |
Exception |
|
getCallbackParameter
public mixed getCallbackParameter |
() |
Output |
mixed
| callback parameter value. |
Exception |
|
getCausesValidation
public boolean getCausesValidation |
() |
Output |
boolean
| whether callback event trigger by this button will cause input validation, default is true |
Exception |
|
getClientSide
Callback client-side options can be set by setting the properties of the ClientSide property. E.g. <com:TCallback ActiveControl.ClientSide.OnSuccess="..." /> See TCallbackClientSide for details on the properties of ClientSide.
|
getClientSideOptions
protected array getClientSideOptions |
() |
Output |
array
| list of callback javascript options. |
Exception |
|
getDefaultClientSideOptions
protected array getDefaultClientSideOptions |
() |
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 setCallbackOptionsID.
Output |
array
| list of default callback client-side options. |
Exception |
|
getJavascript
public string getJavascript |
() |
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 - var request = <%= $this->mycallback->ActiveControl->Javascript %>;
- request.setParameter('hello');
- request.dispatch(); //make the callback request.
Alternatively, - //dispatches immediately
- Prado.Callback("<%= $this->mycallback->UniqueID %>",
- $this->mycallback->ActiveControl->JsCallbackOptions);
Output |
string
| javascript client-side callback request object (javascript code) |
Exception |
|
getJsCallbackOptions
public void getJsCallbackOptions |
(string 0 ) |
Input |
string | 0 | callback requestion options as javascript code. |
Output |
Exception |
|
getValidationGroup
public string getValidationGroup |
() |
Output |
string
| the group of validators which the button causes validation upon callback |
Exception |
|
registerCallbackClientScript
public void registerCallbackClientScript |
(string $class , array $options ) |
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 ClientSide property.
Input |
string | $class | client side javascript class name. |
array | $options | additional callback options. |
Output |
Exception |
|
setCallbackOptions
public void setCallbackOptions |
(string $value ) |
Sets default callback options. Takes the ID of a TCallbackOptions component to duplicate the client-side options for this control. The getClientSide subproperties has precendent over the CallbackOptions property.
Input |
string | $value | ID of a TCallbackOptions control from which ClientSide options are cloned. |
Output |
Exception |
|
setCallbackParameter
public void setCallbackParameter |
(mixed $value ) |
Input |
mixed | $value | callback parameter value. |
Output |
Exception |
|
setCausesValidation
public void setCausesValidation |
(boolean $value ) |
Input |
boolean | $value | whether callback event trigger by this button will cause input validation |
Output |
Exception |
|
setClientSide
Sets the client side options. Can only be set when client side is null.
|
setValidationGroup
public void setValidationGroup |
(string $value ) |
Input |
string | $value | the group of validators which the button causes validation upon callback |
Output |
Exception |
|