PHP Class Prado\Web\UI\ActiveControls\TActiveCustomValidator

Performs custom validation using only server-side {@link onServerValidate onServerValidate} validation event. The client-side uses callbacks to raise the {@link onServerValidate onServerValidate} event. Beware that the {@link onServerValidate onServerValidate} may be raised when the control to validate on the client side changes value, that is, the server validation may be called many times. After the callback or postback, the {@link onServerValidate onServerValidate} is raised once more. The {@link getIsCallback IsCallback} property will be true when validation is made during a callback request.
Since: 3.1
Inheritance: extends Prado\Web\UI\WebControls\TCustomValidator, implements Prado\Web\UI\ActiveControls\ICallbackEventHandler, implements Prado\Web\UI\ActiveControls\IActiveControl
Datei anzeigen Open project: pradosoft/prado

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
getEnableClientScript ( ) : boolean It's mandatory for the EnableClientScript to be activated or the TActiveCustomValidator won't work.
getIsCallback ( ) : boolean
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. The {@link onServerValidate OnServerValidate} event is raised first and then the {@link onCallback OnCallback} event.
setClientValidationFunction ( $value ) Client validation function is NOT supported.
setErrorMessage ( $value ) Sets the text for the error message. Updates client-side error message.
setIsValid ( $value )

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
getClientScriptOptions ( ) : array Returns an array of javascript validator options.

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

getClientScriptOptions() protected method

Returns an array of javascript validator options.
protected getClientScriptOptions ( ) : array
return array javascript validator options.

getClientSide() public method

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

getEnableClientScript() public method

It's mandatory for the EnableClientScript to be activated or the TActiveCustomValidator won't work.
public getEnableClientScript ( ) : boolean
return boolean whether client-side validation is enabled.

getIsCallback() public method

public getIsCallback ( ) : boolean
return boolean true if validation is made during a callback request.

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 )

setClientValidationFunction() public method

Client validation function is NOT supported.
public setClientValidationFunction ( $value )

setErrorMessage() public method

Sets the text for the error message. Updates client-side error message.
public setErrorMessage ( $value )

setIsValid() public method

public setIsValid ( $value )