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

TListControlValidator class file

Author: Wei Zhuo
Copyright: Copyright © 2005 PradoSoft
License: http://www.pradosoft.com/license/
Version: $Id: TListControlValidator.php 1397 2006-09-07 07:55:53Z wei $
Poids: 226 lignes (6 kb)
Inclus ou requis:0 fois
Référencé: 0 fois
Nécessite: 0 fichiers

Définit 1 class

TListControlValidator:: (11 méthodes):
  getClientClassName()
  getMinSelection()
  setMinSelection()
  getMaxSelection()
  setMaxSelection()
  getRequiredSelections()
  setRequiredSelections()
  evaluateIsValid()
  getSelection()
  getRequiredValues()
  getClientScriptOptions()


Classe: TListControlValidator  - X-Ref

TListControlValidator class.

TListControlValidator checks the number of selection and their values
for a <b>TListControl that allows multiple selection</b>.

You can specify the minimum or maximum (or both) number of selections
required using the {@link setMinSelection MinSelection} and
{@link setMaxSelection MaxSelection} properties, respectively. In addition,
you can specify a comma separated list of required selected values via the
{@link setRequiredSelections RequiredSelections} property.

Examples
- At least two selections
<code>
<com:TListBox ID="listbox" SelectionMode="Multiple">
<com:TListItem Text="item1" Value="value1" />
<com:TListItem Text="item2" Value="value2" />
<com:TListItem Text="item3" Value="value3" />
</com:TListBox>

<com:TListControlValidator
ControlToValidate="listbox"
MinSelection="2"
ErrorMessage="Please select at least 2" />
</code>
- "value1" must be selected <b>and</b> at least 1 other
<code>
<com:TCheckBoxList ID="checkboxes">
<com:TListItem Text="item1" Value="value1" />
<com:TListItem Text="item2" Value="value2" />
<com:TListItem Text="item3" Value="value3" />
</com:TCheckBoxList>

<com:TListControlValidator
ControlToValidate="checkboxes"
RequiredSelections="value1"
MinSelection="2"
ErrorMessage="Please select 'item1' and at least 1 other" />
</code>

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

getMinSelection()   X-Ref

return: integer min number of selections. Defaults to -1, meaning not set.

setMinSelection($value)   X-Ref

param: integer minimum number of selections.

getMaxSelection()   X-Ref

return: integer max number of selections.  Defaults to -1, meaning not set.

setMaxSelection($value)   X-Ref

param: integer max number of selections.

getRequiredSelections()   X-Ref
Get a comma separated list of required selected values.

return: string comma separated list of required values.

setRequiredSelections($value)   X-Ref
Set the list of required values, using aa comma separated list.

param: string comma separated list of required values.

evaluateIsValid()   X-Ref
This method overrides the parent's implementation.
The validation succeeds if the input component changes its data
from the InitialValue or the input component is not given.

return: boolean whether the validation succeeds

getSelection($control)   X-Ref

param: TListControl control to validate
return: array number of selected values and its values.

getRequiredValues()   X-Ref

return: array list of required values.

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

return: array javascript validator options.



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