# Class: Component

## jala.Form.Component()

#### new Component()

The abstract base class for all components.

Source:
  - jala/code/Form.js, line 783

### 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:

- jala.Form

Source:
  - jala/code/Form.js, line 814

#### name :String

Readonly reference to name of component

##### Type:

- String

Source:
  - jala/code/Form.js, line 806

#### (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:
  - jala/code/Form.js, line 2261

#### (inner) className :String

Private field containing the CSS class name of this component

##### Type:

- String

Source:
  - jala/code/Form.js, line 800

### 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:
  - jala/code/Form.js, line 862

#### 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:
  - jala/code/Form.js, line 882

##### Returns:

The DOM Id

#### getClassName()

Returns the class name set for this component.

Source:
  - jala/code/Form.js, line 841

##### Returns:

class name

#### getType()

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

Source:
  - jala/code/Form.js, line 832

#### render()

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

Source:
  - jala/code/Form.js, line 890

#### save()

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

Source:
  - jala/code/Form.js, line 908

#### setClassName(newClassName)

Sets an extra classname for this component

##### Parameters:

Name | Type | Description
--- | --- | ---
`newClassName` | String | new classname

Source:
  - jala/code/Form.js, line 849

#### 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:
  - jala/code/Form.js, line 900