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
Afficher le fichier Open project: pradosoft/prado

Méthodes publiques

Méthode 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 )

Méthodes protégées

Méthode 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 méthode

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 méthode

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

getActiveControl() public méthode

public getActiveControl ( ) : TBaseActiveCallbackControl
Résultat TBaseActiveCallbackControl standard callback control options.

getClientClassName() protected méthode

protected getClientClassName ( ) : string
Résultat string corresponding javascript class name for this this.

getClientScriptOptions() protected méthode

Returns an array of javascript validator options.
protected getClientScriptOptions ( ) : array
Résultat array javascript validator options.

getClientSide() public méthode

public getClientSide ( ) : TCallbackClientSide
Résultat TCallbackClientSide client side request options.

getEnableClientScript() public méthode

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

getIsCallback() public méthode

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

onCallback() public méthode

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 méthode

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

setClientValidationFunction() public méthode

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

setErrorMessage() public méthode

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

setIsValid() public méthode

public setIsValid ( $value )