[ Index ]
 

Code source de PRADO 3.0.6

Accédez au Source d'autres logiciels libresSoutenez Angelica Josefina !

title

Body

[fermer]

/framework/Web/UI/WebControls/ -> TCustomValidator.php (sommaire)

TCustomValidator class file

Author: Qiang Xue <qiang.xue@gmail.com>
Copyright: Copyright © 2005 PradoSoft
License: http://www.pradosoft.com/license/
Version: $Id: TCustomValidator.php 1397 2006-09-07 07:55:53Z wei $
Poids: 194 lignes (6 kb)
Inclus ou requis:0 fois
Référencé: 0 fois
Nécessite: 0 fichiers

Définit 2 classes

TCustomValidator:: (7 méthodes):
  getClientClassName()
  getClientValidationFunction()
  setClientValidationFunction()
  evaluateIsValid()
  onServerValidate()
  getClientScriptOptions()
  registerClientScriptValidator()

TServerValidateEventParameter:: (4 méthodes):
  __construct()
  getValue()
  getIsValid()
  setIsValid()


Classe: TCustomValidator  - X-Ref

TCustomValidator class

TCustomValidator performs user-defined validation (either
server-side or client-side or both) on an input component.

To create a server-side validation function, provide a handler for
the {@link onServerValidate OnServerValidate} event that performs the validation.
The data string of the input control to validate can be accessed
by {@link TServerValidateEventParameter::getValue Value} of the event parameter.
The result of the validation should be stored in the
{@link TServerValidateEventParameter::getIsValid IsValid} property of the event
parameter.

To create a client-side validation function, add the client-side
validation javascript function to the page template.
The function should have the following signature:
<code>
<script type="text/javascript"><!--
function ValidationFunctionName(sender, parameter)
{
// if(parameter == ...)
//    return true;
// else
//    return false;
}
--></script>
</code>
Use the {@link setClientValidationFunction ClientValidationFunction} property
to specify the name of the client-side validation script function associated
with the TCustomValidator.

getClientClassName()   X-Ref
Gets the name of the javascript class responsible for performing validation for this control.
This method overrides the parent implementation.

return: string the javascript class name

getClientValidationFunction()   X-Ref

return: string the name of the custom client-side script function used for validation.

setClientValidationFunction($value)   X-Ref
Sets the name of the custom client-side script function used for validation.

param: string the script function name

evaluateIsValid()   X-Ref
This method overrides the parent's implementation.
The validation succeeds if {@link onServerValidate} returns true.

return: boolean whether the validation succeeds

onServerValidate($value)   X-Ref
This method is invoked when the server side validation happens.
It will raise the <b>OnServerValidate</b> event.
The method also allows derived classes to handle the event without attaching a delegate.
<b>Note</b> The derived classes should call parent implementation
to ensure the <b>OnServerValidate</b> event is raised.

param: string the value to be validated
return: boolean whether the value is valid

getClientScriptOptions()   X-Ref
Returns an array of javascript validator options.

return: array javascript validator options.

registerClientScriptValidator()   X-Ref
Only register the client-side validator if
{@link setClientValidationFunction ClientValidationFunction} is set.


Classe: TServerValidateEventParameter  - X-Ref

TServerValidateEventParameter class

TServerValidateEventParameter encapsulates the parameter data for
<b>OnServerValidate</b> event of TCustomValidator components.

__construct($value,$isValid)   X-Ref
Constructor.

param: string property value to be validated
param: boolean whether the value is valid

getValue()   X-Ref

return: string value to be validated

getIsValid()   X-Ref

return: boolean whether the value is valid

setIsValid($value)   X-Ref

param: boolean whether the value is valid



Généré le : Sun Feb 25 21:07:04 2007 par Balluche grâce à PHPXref 0.7