Class \Prado\Web\UI\ActiveControls\TActiveCustomValidator
TActiveCustomValidator Class
Performs custom validation using only server-side \Prado\Web\UI\ActiveControls\onServerValidate validation event. The client-side uses callbacks to raise the \Prado\Web\UI\ActiveControls\onServerValidate event.
Beware that the \Prado\Web\UI\ActiveControls\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 \Prado\Web\UI\ActiveControls\onServerValidate is raised once more. The \Prado\Web\UI\ActiveControls\getIsCallback property will be true when validation is made during a callback request.
Class hierarchy
- \Prado\Web\UI\ActiveControls\TActiveCustomValidator implements IActiveControl, ICallbackEventHandler
- \Prado\Web\UI\WebControls\TCustomValidator
- \Prado\Web\UI\WebControls\TBaseValidator implements IValidator
- \Prado\Web\UI\WebControls\TLabel implements IDataRenderer
- \Prado\Web\UI\WebControls\TWebControl implements IStyleable
- \Prado\Web\UI\TControl implements IRenderable, IBindable
- \Prado\TApplicationComponent
- \Prado\TComponent
Since: 3.1
public
|
__construct() : mixed
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
|
|
public
|
|
public
|
getEnableClientScript() : bool
It's mandatory for the EnableClientScript to be activated or the TActiveCustomValidator won't work.
|
public
|
|
public
|
onCallback(TCallbackEventParameter $param) : mixed
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
|
raiseCallbackEvent(TCallbackEventParameter $param) : mixed
Raises the callback event. This method is required by {@see
ICallbackEventHandler} interface. The {@see onServerValidate
OnServerValidate} event is raised first and then the
{@see onCallback OnCallback} event.
This method is mainly used by framework and control developers. |
public
|
|
public
|
setErrorMessage(string $value) : mixed
Sets the text for the error message. Updates client-side error message.
|
public
|
|
protected
|
addAttributesToRender(mixed $writer) : mixed
Ensure that the ID attribute is rendered and registers the javascript code
for initializing the active control.
|
protected
|
getClientClassName() : string
Gets the name of the javascript class responsible for performing validation for this control.
|
protected
|
getClientScriptOptions() : array<string|int, mixed>
Returns an array of javascript validator options.
|