Class: Component

jala.Form.Component()

new Component()

The abstract base class for all components.
Source:

Classes

Button
Checkbox
Date
Fieldset
File
Hidden
Image
Input
Password
Radio
Select
Skin
Submit
Textarea

Members

form :jala.Form

Readonly reference to instance of jala.Form.
Type:
Source:

name :String

Readonly reference to name of component
Type:
  • String
Source:

(static) Image

FIXME: JSDoc has some sever problems with this class. It's somehow due to the named method ("Image") that it always appears as global static object. Wrapping the method in another function which immediately is executed seems to solve this problem and could be used as a work-around for similar issues.
Source:

(inner) className :String

Private field containing the CSS class name of this component
Type:
  • String
Source:

Methods

containsFileUpload()

Function defining wheter a component contains a file upload or not. This value is used to render a form tag with the attribute enctype=multipart/form-data. Subclasses of jala.Form.Component that use a file upload element, have to override this function and let it return true.
Source:

createDomId(idPart)

Creates a DOM identifier based on the name of the form, the name of the component and an additional string. The items will be chained using camel casing.
Parameters:
Name Type Description
idPart String Optional string appended to component's id.
Source:
Returns:
The DOM Id

getClassName()

Returns the class name set for this component.
Source:
Returns:
class name

getType()

Returns the type of component. This is the lowercase'd name of the constructor function.
Source:

render()

Function to render a component. Subclasses of jala.Form.Component may override this function.
Source:

save()

Function to save the data of a component. Subclasses of jala.Form.Component may override this function.
Source:

setClassName(newClassName)

Sets an extra classname for this component
Parameters:
Name Type Description
newClassName String new classname
Source:

validate(tracker)

Function to validate a component. Subclasses of jala.Form.Component may override this function.
Parameters:
Name Type Description
tracker jala.Form.Tracker object tracking errors and holding parsed values and request data.
Source: