CWIS Developer Documentation

- Home
- Main Page
- Namespaces
- Classes
- Files

- Class List
- Class Index
- Class Hierarchy
- Class Members

List of all members
OptionFormField Class Reference

Generator for option form fields. More...

Inheritance diagram for OptionFormField:
[legend]
Collaboration diagram for OptionFormField:
[legend]

## Setup/Initialization
| OptionFormField ($Name, $IsRequired, $Label, $Length, $Options, $ValidFunc=NULL, $ValidMsgs=NULL)
| Object constructor.

## Accessors
| Length ($NewVal=NULL)
| Get or set the length of the display field.
| Options ($NewVal=NULL)
| Get or set the list of options displayed by this field.

## Display
| PrintInput ($DisplayErrorIndicator=FALSE)
| Generate HTML representing this object.

## Additional Inherited Members
Public Member Functions inherited from FormField
| FormField ($Name, $IsRequired, $Label, $ValidFunc, $ValidMsgs)
| Object Constructor.
| Name ($NewVal=NULL)
| Get or set Name (internal name for id=)
| IsRequired ($NewVal=NULL)
| Get/set IsRequired.
| Label ($NewVal=NULL)
| Get or set the Label (display name in generated HTML)
| Value ($NewVal=NULL)
| Get or set the field's value.
| IsPassword ()
| Determine if this field is a password fild.
| PrintField ($DisplayErrorIndicator=FALSE)
| Print the label and generate input tags for this object.
| PrintLabel ($DisplayErrorIndicator=FALSE)
| Print the label for this field without generating the input tags.
| IsInvalidValue ($Value)
| Check the validity of the field's value.
| GetInvalidValueMessage ($ErrorCode)
| Map an error code from IsInvalidValue to an error message.
Protected Attributes inherited from FormField
| $MyName
| $MyIsRequired
| $MyLabel
| $MyValue
| $MyValidFunc
| $MyValidMsgs

## Detailed Description

Generator for option form fields.

Definition at line 8 of file OptionFormField.php.

## Member Function Documentation

OptionFormField::Length | ( |  | $NewVal = `NULL` | ) |

Get or set the length of the display field.

Parameters

  NewVal | (OPTIONAL)

Returns
  Current length

Definition at line 44 of file OptionFormField.php.

OptionFormField::OptionFormField | ( |  | $Name,
|  |  | $IsRequired,
|  |  | $Label,
|  |  | $Length,
|  |  | $Options,
|  |  | $ValidFunc = `NULL`,
|  |  | $ValidMsgs = `NULL`
| ) |  |

Object constructor.

Parameters

  Name | Internal name for this option, used for html id=
  IsRequired |
  Label | Display label, shown to user in generated html
  Length | Maximum length allowed
  Options | Names of the options in this group, an array
  ValidFunc | Function to check the validity of this field
  ValidMsgs | Error messages associated with error codes from ValidFunc

Definition at line 25 of file OptionFormField.php.

References FormField\FormField().

OptionFormField::Options | ( |  | $NewVal = `NULL` | ) |

Get or set the list of options displayed by this field.

Parameters

  NewVal | An array of strings to use for option names (OPTIONAL)

Returns
  Current list of options

Definition at line 51 of file OptionFormField.php.

OptionFormField::PrintInput | ( |  | $DisplayErrorIndicator = `FALSE` | ) |

Generate HTML representing this object.

Parameters

  DisplayErrorIndicator | (OPTIONAL)

Definition at line 62 of file OptionFormField.php.

References FormField\Value().

The documentation for this class was generated from the following file:

- objects/OptionFormField.php