PHP Class Prado\Web\UI\ActiveControls\TActiveButton

When a TActiveButton is clicked, rather than a normal post back request a callback request is initiated. The {@link onCallback OnCallback} event is raised during a callback request and it is raise after the {@link onClick OnClick} event. When the {@link TBaseActiveCallbackControl::setEnableUpdate ActiveControl.EnableUpdate} property is true, changing the {@link setText Text} property during callback request will update the button's caption upon callback response completion.
Since: 3.1
Inheritance: extends Prado\Web\UI\WebControls\TButton, implements Prado\Web\UI\ActiveControls\ICallbackEventHandler, implements Prado\Web\UI\ActiveControls\IActiveControl
Show file Open project: pradosoft/prado Class Usage Examples

Public Methods

Method Description
__construct ( ) 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, by calling this constructor.
getActiveControl ( ) : TBaseActiveCallbackControl
getClientSide ( ) : TCallbackClientSide
onCallback ( $param ) 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.
raiseCallbackEvent ( $param ) Raises the callback event. This method is required by {@link ICallbackEventHandler} interface. If {@link getCausesValidation CausesValidation} is true, it will invoke the page's {@link TPage::validate validate} method first. It will raise {@link onClick OnClick} event first and then the {@link onCallback OnCallback} event.
setText ( $value ) Updates the button text on the client-side if the {@link setEnableUpdate EnableUpdate} property is set to true.

Protected Methods

Method Description
addAttributesToRender ( $writer ) Ensure that the ID attribute is rendered and registers the javascript code for initializing the active control.
getClientClassName ( ) : string
renderClientControlScript ( $writer ) Override parent implementation, no javascript is rendered here instead the javascript required for active control is registered in {@link addAttributesToRender}.

Method Details

__construct() public method

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, by calling this constructor.
public __construct ( )

addAttributesToRender() protected method

Ensure that the ID attribute is rendered and registers the javascript code for initializing the active control.
protected addAttributesToRender ( $writer )

getActiveControl() public method

public getActiveControl ( ) : TBaseActiveCallbackControl
return TBaseActiveCallbackControl standard callback control options.

getClientClassName() protected method

protected getClientClassName ( ) : string
return string corresponding javascript class name for this TActiveButton.

getClientSide() public method

public getClientSide ( ) : TCallbackClientSide
return TCallbackClientSide client side request options.

onCallback() public method

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 onCallback ( $param )

raiseCallbackEvent() public method

This method is mainly used by framework and control developers.
public raiseCallbackEvent ( $param )

renderClientControlScript() protected method

Override parent implementation, no javascript is rendered here instead the javascript required for active control is registered in {@link addAttributesToRender}.
protected renderClientControlScript ( $writer )

setText() public method

Updates the button text on the client-side if the {@link setEnableUpdate EnableUpdate} property is set to true.
public setText ( $value )