Class ONEGEEK.forms.FormFieldFactory


class ONEGEEK.forms.FormFieldFactory
The Form Field Factory provides a way to lookup a specific type of FormField subclass without having to know the concreate class name in advance i.e. To get a FormField object associated with the 'phone' class try: factory.lookup('phone', field) ;
Defined in ONEGEEK.forms

Variable Summary
Create a global instance of the factory.
The set of form fields registered to listen on form element classNames i.e.

Function Summary
public ONEGEEK.forms.AbstractFormField lookupFormField (String name, DOMElement field)
Lookup a form field object from the list of registered FormField objects
public void registerFormField (String classname, String objectClass, [Array options])
Register a FormField subclass with the factory

Variable Details

variable public ONEGEEK.forms.FormFieldFactory formFieldFactory

Create a global instance of the factory.

variable String[] formFieldRegister

The set of form fields registered to listen on form element classNames i.e. Checkbox (ONEGEEK.forms.Checkbox)

Function Details

function lookupFormField

public ONEGEEK.forms.AbstractFormField lookupFormField(String name, DOMElement field)
Lookup a form field object from the list of registered FormField objects
Parameters:
name The class name of the field
field The DOM form field element to attach the class to
Returns:
A new instance of a ONEGEEK.forms.AbstractFormField subclass if found, or null if not found

function registerFormField

public void registerFormField(String classname, String objectClass, [Array options])
Register a FormField subclass with the factory
Parameters:
classname The name of the CSS class associated with the FormField i.e. 'firstname'
objectClass The FormField concrete subclass i.e. NameField
[options] The options to pass in to the object
Returns:
void