Class TBaseActiveCallbackControl

Description

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 sets the validation group property of a TCallback component.

  1.      <com:TCallback ActiveControl.ValidationGroup="group1" ... />

Additional client-side options and events can be set using the ClientSide property. The following example shows an alert box when a TCallback component response returns successfully.

  1.      <com:TCallback ActiveControl.ClientSide.OnSuccess="alert('ok!')" ... />

  • author: Wei Zhuo <weizhuo[at]gmail[dot]com>
  • version: $Id: TBaseActiveControl.php 3164 2012-06-12 14:39:26Z ctrlaltca $
  • since: 3.1

Located in /Web/UI/ActiveControls/TBaseActiveControl.php (line 162)

TComponent
   |
   --TBaseActiveControl
      |
      --TBaseActiveCallbackControl
Method Summary
boolean canCauseValidation ()
string getCallbackOptions ()
boolean getCausesValidation ()
string getJavascript ()
void getJsCallbackOptions (string 0)
string getValidationGroup ()
void registerCallbackClientScript (string $class, [array $options = null])
void setCallbackOptions (string $value)
void setCallbackParameter (mixed $value)
void setCausesValidation (boolean $value)
void setValidationGroup (string $value)
Methods
canCauseValidation (line 294)
  • return: whether to perform validation if the callback is requested.
  • access: public
boolean canCauseValidation ()
createClientSide (line 196)
  • return: callback client-side options.
  • access: protected
TCallbackClientSide createClientSide ()
getCallbackOptions (line 218)
  • return: ID of a TCallbackOptions control from which ClientSide options are duplicated.
  • access: public
string getCallbackOptions ()
getCallbackParameter (line 316)
  • return: callback parameter value.
  • access: public
mixed getCallbackParameter ()
getCausesValidation (line 258)
  • return: whether callback event trigger by this button will cause input validation, default is true
  • access: public
boolean getCausesValidation ()
getClientSide (line 170)

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.

  • return: client-side callback options.
  • access: public
TCallbackClientSide getClientSide ()
getClientSideOptions (line 325)
  • return: list of callback javascript options.
  • access: protected
array getClientSideOptions ()
getDefaultClientSideOptions (line 229)

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 setCallbackOptions.

  • return: list of default callback client-side options.
  • access: protected
array getDefaultClientSideOptions ()
getJavascript (line 378)

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

  1.    var request = <%= $this->mycallback->ActiveControl->Javascript %>;
  2.    request.setParameter('hello');
  3.    request.dispatch()//make the callback request.

Alternatively,

  1.  //dispatches immediately
  2.  Prado.Callback("<%= $this->mycallback->UniqueID %>",
  3.     $this->mycallback->ActiveControl->JsCallbackOptions);

  • return: javascript client-side callback request object (javascript code)
  • access: public
string getJavascript ()
getJsCallbackOptions (line 387)
  • access: public
void getJsCallbackOptions (string 0)
  • string 0: callback requestion options as javascript code.
getValidationGroup (line 276)
  • return: the group of validators which the button causes validation upon callback
  • access: public
string getValidationGroup ()
registerCallbackClientScript (line 345)

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.

  • access: public
void registerCallbackClientScript (string $class, [array $options = null])
  • string $class: client side javascript class name.
  • array $options: additional callback options.
setCallbackOptions (line 209)

Sets default callback options. Takes the ID of a TCallbackOptions component to duplicate the client-side options for this control. The getClientSide subproperties takes precedence over the CallbackOptions property.

  • access: public
void setCallbackOptions (string $value)
  • string $value: ID of a TCallbackOptions control from which ClientSide options are cloned.
setCallbackParameter (line 308)
  • access: public
void setCallbackParameter (mixed $value)
  • mixed $value: callback parameter value.
setCausesValidation (line 267)
  • access: public
void setCausesValidation (boolean $value)
  • boolean $value: whether callback event trigger by this button will cause input validation
setClientSide (line 184)

Sets the client side options. Can only be set when client side is null.

  • access: public
void setClientSide (TCallbackClientSide $client)
setValidationGroup (line 285)
  • access: public
void setValidationGroup (string $value)
  • string $value: the group of validators which the button causes validation upon callback

Inherited Methods

Inherited From TBaseActiveControl

TBaseActiveControl::__construct()
TBaseActiveControl::canUpdateClientSide()
TBaseActiveControl::getControl()
TBaseActiveControl::getEnableUpdate()
TBaseActiveControl::getOption()
TBaseActiveControl::getOptions()
TBaseActiveControl::getPage()
TBaseActiveControl::setEnableUpdate()
TBaseActiveControl::setOption()

Inherited From TComponent

TComponent::addParsedObject()
TComponent::attachEventHandler()
TComponent::canGetProperty()
TComponent::canSetProperty()
TComponent::createdOnTemplate()
TComponent::detachEventHandler()
TComponent::evaluateExpression()
TComponent::evaluateStatements()
TComponent::getEventHandlers()
TComponent::getSubProperty()
TComponent::hasEvent()
TComponent::hasEventHandler()
TComponent::hasProperty()
TComponent::raiseEvent()
TComponent::setSubProperty()
TComponent::__call()
TComponent::__get()
TComponent::__set()
TComponent::__sleep()
TComponent::__wakeup()

Documentation generated on Mon, 25 Jun 2012 14:37:21 +0200 by phpDocumentor 1.4.3