PHP Класс 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.
С версии: 3.1
Наследование: extends Prado\Web\UI\WebControls\TCustomValidator, implements Prado\Web\UI\ActiveControls\ICallbackEventHandler, implements Prado\Web\UI\ActiveControls\IActiveControl
Показать файл Открыть проект

Открытые методы

Метод Описание
__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 )

Защищенные методы

Метод Описание
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.

Описание методов

__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.
public __construct ( )

addAttributesToRender() защищенный Метод

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

getActiveControl() публичный Метод

public getActiveControl ( ) : TBaseActiveCallbackControl
Результат TBaseActiveCallbackControl standard callback control options.

getClientClassName() защищенный Метод

protected getClientClassName ( ) : string
Результат string corresponding javascript class name for this this.

getClientScriptOptions() защищенный Метод

Returns an array of javascript validator options.
protected getClientScriptOptions ( ) : array
Результат array javascript validator options.

getClientSide() публичный Метод

public getClientSide ( ) : TCallbackClientSide
Результат TCallbackClientSide client side request options.

getEnableClientScript() публичный Метод

It's mandatory for the EnableClientScript to be activated or the TActiveCustomValidator won't work.
public getEnableClientScript ( ) : boolean
Результат boolean whether client-side validation is enabled.

getIsCallback() публичный Метод

public getIsCallback ( ) : boolean
Результат boolean true if validation is made during a callback request.

onCallback() публичный Метод

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() публичный Метод

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

setClientValidationFunction() публичный Метод

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

setErrorMessage() публичный Метод

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

setIsValid() публичный Метод

public setIsValid ( $value )