[ 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/ -> TBaseValidator.php (sommaire)

TBaseValidator class file

Author: Qiang Xue <qiang.xue@gmail.com>
Copyright: Copyright © 2005 PradoSoft
License: http://www.pradosoft.com/license/
Version: $Id: TBaseValidator.php 1510 2006-11-25 21:13:03Z xue $
Poids: 715 lignes (22 kb)
Inclus ou requis:0 fois
Référencé: 0 fois
Nécessite: 0 fichiers

Définit 3 classes

TValidatorClientSide:: (8 méthodes):
  getOnValidate()
  setOnValidate()
  setOnSuccess()
  getOnSuccess()
  setOnError()
  getOnError()
  setObserveChanges()
  getObserveChanges()

TValidatorDisplayStyle:: (0 méthodes):

TValidationDataType:: (0 méthodes):

Définit 0 fonctions

  __construct()
  onInit()
  onUnload()
  addAttributesToRender()
  getClientScriptOptions()
  getClientControlClass()
  getClientSide()
  createClientSide()
  onPreRender()
  updateControlCssClass()
  registerClientScriptValidator()
  setForControl()
  setEnabled()
  getDisplay()
  setDisplay()
  getEnableClientScript()
  setEnableClientScript()
  getErrorMessage()
  setErrorMessage()
  getControlToValidate()
  setControlToValidate()
  getFocusOnError()
  setFocusOnError()
  getFocusElementID()
  setFocusElementID()
  getValidationGroup()
  setValidationGroup()
  getIsValid()
  setIsValid()
  getValidationTarget()
  getValidationValue()
  validate()
  getControlCssClass()
  setControlCssClass()
  onSuccess()
  onError()
  onValidate()
  renderContents()

Classe: TValidatorClientSide  - X-Ref

TValidatorClientSide class.

Client-side validator events can be modified through the {@link
TBaseValidator::getClientSide ClientSide} property of a validator. The
subproperties of ClientSide are those of the TValidatorClientSide
properties. The client-side validator supports the following events.

The <tt>OnValidate</tt> event is raise before the validator validation
functions are called.

The <tt>OnSuccess</tt> event is raised after the validator has successfully
validate the control.

The <tt>OnError</tt> event is raised after the validator fails validation.

See the quickstart documentation for further details.

getOnValidate()   X-Ref

return: string javascript code for client-side OnValidate event.

setOnValidate($javascript)   X-Ref
Client-side OnValidate validator event is raise before the validators
validation functions are called.

param: string javascript code for client-side OnValidate event.

setOnSuccess($javascript)   X-Ref
Client-side OnSuccess event is raise after validation is successfull.
This will override the default client-side validator behaviour.

param: string javascript code for client-side OnSuccess event.

getOnSuccess()   X-Ref

return: string javascript code for client-side OnSuccess event.

setOnError($javascript)   X-Ref
Client-side OnError event is raised after validation failure.
This will override the default client-side validator behaviour.

param: string javascript code for client-side OnError event.

getOnError()   X-Ref

return: string javascript code for client-side OnError event.

setObserveChanges($value)   X-Ref

param: boolean true to revalidate when the control to validate changes value.

getObserveChanges()   X-Ref

return: boolean true to observe changes.

Classe: TValidatorDisplayStyle  - X-Ref

TValidatorDisplayStyle class.
TValidatorDisplayStyle defines the enumerable type for the possible styles
that a validator control can display the error message.

The following enumerable values are defined:
- None: the error message is not displayed
- Dynamic: the error message dynamically appears when the validator fails validation
- Fixed: Similar to Dynamic except that the error message physically occupies the page layout (even though it may not be visible)

Classe: TValidationDataType  - X-Ref

TValidationDataType class.
TValidationDataType defines the enumerable type for the possible data types that
a comparison validator can validate upon.

The following enumerable values are defined:
- Integer
- Float
- Date
- String

Fonctions
Fonctions qui ne font pas partie d'une Classe:

__construct()   X-Ref
Constructor.
This method sets the foreground color to red.


onInit($param)   X-Ref
Registers the validator with page.

param: mixed event parameter

onUnload($param)   X-Ref
Unregisters the validator from page.

param: mixed event parameter

addAttributesToRender($writer)   X-Ref
Adds attributes to renderer.

param: THtmlWriter the renderer

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

return: array javascript validator options.

getClientControlClass($control)   X-Ref
Gets the Control type for client-side validation. If new cases exists in
TBaseValidator::$_clientClass, be sure to update the corresponding
"Javascript/validation3.js" file as well.

param: TControl control to validate.
return: string control type for client-side validation.

getClientSide()   X-Ref
Gets the TValidatorClientSide that allows modification of the client-
side validator events.

The client-side validator supports the following events.
# <tt>OnValidate</tt> -- raised before client-side validation is
executed.
# <tt>OnSuccess</tt> -- raised after client-side validation is completed
and is successfull, overrides default validator error messages updates.
# <tt>OnError</tt> -- raised after client-side validation is completed
and failed, overrides default validator error message updates.

You can attach custom javascript code to each of these events

return: TValidatorClientSide javascript validator event options.

createClientSide()   X-Ref

return: TValidatorClientScript javascript validator event options.

onPreRender($param)   X-Ref
Renders the javascript code to the end script.
If you override this method, be sure to call the parent implementation
so that the event handlers can be invoked.

param: TEventParameter event parameter to be passed to the event handlers

updateControlCssClass()   X-Ref
Update the ControlToValidate component's css class depending
if the ControlCssClass property is set, and whether this is valid.

return: boolean true if change, false otherwise.

registerClientScriptValidator()   X-Ref
Registers the individual validator client-side javascript code.


setForControl($value)   X-Ref
This method overrides the parent implementation to forbid setting ForControl.

param: string the associated control ID

setEnabled($value)   X-Ref
This method overrides parent's implementation by setting {@link setIsValid IsValid} to true if disabled.

param: boolean whether the validator is enabled.

getDisplay()   X-Ref

return: TValidatorDisplayStyle the style of displaying the error message. Defaults to TValidatorDisplayStyle::Fixed.

setDisplay($value)   X-Ref

param: TValidatorDisplayStyle the style of displaying the error message

getEnableClientScript()   X-Ref

return: boolean whether client-side validation is enabled.

setEnableClientScript($value)   X-Ref

param: boolean whether client-side validation is enabled.

getErrorMessage()   X-Ref

return: string the text for the error message.

setErrorMessage($value)   X-Ref
Sets the text for the error message.

param: string the error message

getControlToValidate()   X-Ref

return: string the ID path of the input control to validate

setControlToValidate($value)   X-Ref
Sets the ID path of the input control to validate.
The ID path is the dot-connected IDs of the controls reaching from
the validator's naming container to the target control.

param: string the ID path

getFocusOnError()   X-Ref

return: boolean whether to set focus at the validating place if the validation fails. Defaults to false.

setFocusOnError($value)   X-Ref

param: boolean whether to set focus at the validating place if the validation fails

getFocusElementID()   X-Ref
Gets the ID of the HTML element that will receive focus if validation fails and {@link getFocusOnError FocusOnError} is true.
Defaults to the client ID of the {@link getControlToValidate ControlToValidate}.

return: string the ID of the HTML element to receive focus

setFocusElementID($value)   X-Ref
Sets the ID of the HTML element that will receive focus if validation fails and {@link getFocusOnError FocusOnError} is true.

param: string the ID of the HTML element to receive focus

getValidationGroup()   X-Ref

return: string the group which this validator belongs to

setValidationGroup($value)   X-Ref

param: string the group which this validator belongs to

getIsValid()   X-Ref

return: boolean whether the validation succeeds

setIsValid($value)   X-Ref
Sets the value indicating whether the validation succeeds

param: boolean whether the validation succeeds

getValidationTarget()   X-Ref

return: TControl control to be validated. Null if no control is found.

getValidationValue($control)   X-Ref
Retrieves the property value of the control being validated.

param: TControl control being validated
return: string property value to be validated

validate()   X-Ref
Validates the specified control.
Do not override this method. Override {@link evaluateIsValid} instead.

return: boolean whether the validation succeeds

getControlCssClass()   X-Ref

return: string the css class that is applied to the control being validated in case the validation fails

setControlCssClass($value)   X-Ref

param: string the css class that is applied to the control being validated in case the validation fails

onSuccess()   X-Ref
This event is raised when the validator succeeds in validation.


onError()   X-Ref
This event is raised when the validator fails in validation.


onValidate()   X-Ref
This event is raised right before the validator starts to perform validation.
You may use this event to change the behavior of validation.
For example, you may disable the validator if certain condition is satisfied.
Note, the event will NOT be raised if the validator is invisible.


renderContents($writer)   X-Ref
Renders the validator control.

param: THtmlWriter writer for the rendering purpose



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