## helma.Html

    Object
       |
       +--helma.Html

This class provides various methods for rendering X/Html tags.
Defined in Html.js

SUMMARY: Constructor | Properties | Methods | DETAIL: Constructor | Properties | Methods

Constructor Summary
`helma.Html()` Creates a new instance of helma.Html

Methods Summary
`String` | `activateUrls(<String> str)` Parses the string passed as argument and converts any URL in it into a link tag
`void` | `button(<Object> param)` Renders an x/html button input tag
`String` | `buttonAsString(attr)` Returns a rendered x/html button input tag
`void` | `checkBox(<Object> param)` Renders an x/html checkbox input tag
`String` | `checkBoxAsString(<Object> attr)` Returns a rendered x/html checkbox input tag
`void` | `closeLink()` Renders an x/html closing link tag
`String` | `closeLinkAsString()` Returns a rendered x/html closing link tag
`void` | `closeTag(<String> name)` Renders the closing tag of an arbitrary x/html tag
`String` | `closeTagAsString(<String> name)` Returns the closing tag of an arbitray x/html element
`void` | `color(<String> c)` Renders a color definition string.
`String` | `colorAsString(<String> c)` Returns a color definition.
`void` | `dropDown(<Object> param, <Array> options, <String> selectedValue, <String> firstOption)` Renders a x/html drop down select box
`String` | `dropDownAsString(attr, <Array> options, <String> selectedValue, <String> firstOption)` Returns a rendered x/html drop down select box
`void` | `element(<String> name, <String> str, <Object> attr)` Renders an arbitrary x/html element
`String` | `elementAsString(<String> name, <String> str, <Object> attr)` Return an arbitrary x/html element
`void` | `file(<Object> attr)` Renders an x/html file input tag
`String` | `fileAsString(<Object> attr)` Returns a rendered x/html file input tag
`void` | `form(<Object> attr)` Renders an x/html opening form tag
`String` | `formAsString(<Object> attr)` Returns an x/html opening form tag
`void` | `hidden(<Object> param)` Renders an x/html input tag of type "hidden"
`String` | `hiddenAsString(<Object> attr)` Returns a rendered x/html input tag of type "hidden"
`void` | `input(<Object> param)` Renders an x/html text input tag
`String` | `inputAsString(<Object> attr)` Returns a rendered x/html text input tag
`void` | `link(<Object> attr, <String> text)` Renders an x/html link tag
`String` | `linkAsString(<Object> attr, <String> text)` Returns a rendered x/html link tag
`void` | `map(<String> name, <Array> param)` Renders an image map based on an array containing the map parameters.
`String` | `mapAsString(<String> name, <Array> areas)` Returns a rendered image map based on an array containing the map parameters.
`void` | `openLink(<Object> attr)` Renders an x/html opening link tag
`String` | `openLinkAsString(<Object> attr)` Returns an x/html opening link tag
`void` | `openTag(<String> name, <Object> attr)` Renders the opening tag of an arbitrary x/html tag
`String` | `openTagAsString(<String> name, <Object> attr)` Returns the opening tag of an arbitrary x/html tag
`void` | `password(<Object> attr)` Renders an x/html password input tag
`String` | `passwordAsString(<Object> attr)` Returns a rendered x/html password input tag
`void` | `radioButton(<Object> param)` Renders an x/html radiobutton input tag
`String` | `radioButtonAsString(<Object> attr)` Returns a rendered x/html radio input tag
`void` | `submit(<Object> param)` Renders an x/html submit input tag
`String` | `submitAsString(<Object> attr)` Returns a rendered x/html submit input tag
`void` | `table(<Array> headers, <Array> data, <Object> param)` Renders a complete x/html table.
`String` | `tableAsString(<Array> headers, <Array> data, <Object> attr)` Returns a rendered x/html table
`void` | `tag(<String> name, <Object> attr)` Renders an empty arbitrary x/html tag ("contentless tag")
`String` | `tagAsString(<String> name, <Object> attr)` Returns an empty arbitrary x/html tag ("contentless tag")
`void` | `textArea(<Object> param)` Renders an x/html textarea tag
`String` | `textAreaAsString(<Object> attr)` Returns a rendered x/html textarea tag
`<static> Boolean` | `isSelected(<String> value, <String|Array> selectedValue)` Static helper method used in helma.Html.checkBox and helma.Html.dropDown to check if a current value matches against one or more selected values passed as argument
`<static> void` | `renderMarkupPart(<String> name, <String> start, <String> end, <Object> attr)` Static helper method that renders an arbitrary markup part.

Constructor Detail

### helma.Html

    helma.Html()

Creates a new instance of helma.Html

Returns:

A newly created instance of helma.Html

Method Detail

### activateUrls

    String activateUrls(<String> str)

Parses the string passed as argument and converts any URL in it into a link tag

Parameters:

`str` - The string wherein URLs should be converted into link tags

Returns:

The string containing URLs converted into link tags

### button

    void button(<Object> param)

Renders an x/html button input tag

Parameters:

`param` - An object containing the tag attributes

### buttonAsString

    String buttonAsString(attr)

Returns a rendered x/html button input tag

Parameters:

`param` - An object containing the tag attributes

Returns:

The rendered button input tag

See:

- button()

### checkBox

    void checkBox(<Object> param)

Renders an x/html checkbox input tag

Parameters:

`param` - An object containing the tag attributes

### checkBoxAsString

    String checkBoxAsString(<Object> attr)

Returns a rendered x/html checkbox input tag

Parameters:

`attr` - An object containing the tag attributes

Returns:

The rendered checkbox tag

See:

- checkBox()

### closeLink

    void closeLink()

Renders an x/html closing link tag

### closeLinkAsString

    String closeLinkAsString()

Returns a rendered x/html closing link tag

Returns:

Rhe rendered closing link tag

See:

- closeLink()

### closeTag

    void closeTag(<String> name)

Renders the closing tag of an arbitrary x/html tag

Parameters:

`name` - The tag name

### closeTagAsString

    String closeTagAsString(<String> name)

Returns the closing tag of an arbitray x/html element

Parameters:

`name` - The tag name

Returns:

The rendered closing tag

See:

- closeTag()

### color

    void color(<String> c)

Renders a color definition string. If the string passed as argument contains only hex characters it will be prefixed with a hash sign if necessary, otherwise this method assumes that the value is a named color (eg. "yellow").

Parameters:

`c` - The color definintion

Deprecated

### colorAsString

    String colorAsString(<String> c)

Returns a color definition.

Parameters:

`c` - The color definintion

Returns:

The rendered color definition

Deprecated
See:

- color()

### dropDown

    void dropDown(<Object> param, <Array> options, <String> selectedValue, <String> firstOption)

Renders a x/html drop down select box

Parameters:

`param` - An object containing the tag attributes

`options` - Either an array of strings, an array with several `{value: v, display: d}` objects, or a collection of `["value", "display"]` arrays in an array

`selectedValue` - The value to pre-select

`firstOption` - An optional first option to display in the select box (this option will always have no value)

### dropDownAsString

    String dropDownAsString(attr, <Array> options, <String> selectedValue, <String> firstOption)

Returns a rendered x/html drop down select box

Parameters:

`options` - Either an array of strings, an array with several `{value: v, display: d}` objects, or a collection of `["value", "display"]` arrays in an array

`selectedValue` - The value to pre-select

`firstOption` - An optional first option to display in the select box (this option will always have no value)

`param` - An object containing the tag attributes

Returns:

The rendered drop down select box

See:

- dropDown()

### element

    void element(<String> name, <String> str, <Object> attr)

Renders an arbitrary x/html element

Parameters:

`name` - The element name

`str` - The content of the element

`attr` - An optional object containing element attributes

### elementAsString

    String elementAsString(<String> name, <String> str, <Object> attr)

Return an arbitrary x/html element

Parameters:

`name` - The element name

`str` - The content of the element

`attr` - An optional object containing element attributes

Returns:

The rendered element

See:

- element()

### file

    void file(<Object> attr)

Renders an x/html file input tag

Parameters:

`attr` - An object containing the tag attributes

### fileAsString

    String fileAsString(<Object> attr)

Returns a rendered x/html file input tag

Parameters:

`attr` - An object containing the tag attributes

Returns:

The rendered file input tag

See:

- file()

### form

    void form(<Object> attr)

Renders an x/html opening form tag

Parameters:

`attr` - An object containing the tag attributes

### formAsString

    String formAsString(<Object> attr)

Returns an x/html opening form tag

Parameters:

`attr` - An object containing the tag attributes

Returns:

The rendered opening form tag

See:

- form()

### hidden

    void hidden(<Object> param)

Renders an x/html input tag of type "hidden"

Parameters:

`param` - An object containing the tag attributes

### hiddenAsString

    String hiddenAsString(<Object> attr)

Returns a rendered x/html input tag of type "hidden"

Parameters:

`attr` - An object containing the tag attributes

Returns:

The rendered input element

See:

- hidden()

### input

    void input(<Object> param)

Renders an x/html text input tag

Parameters:

`param` - An object containing the tag attributes

### inputAsString

    String inputAsString(<Object> attr)

Returns a rendered x/html text input tag

Parameters:

`attr` - An object containing the tag attributes

Returns:

The rendered text input tag

See:

- input()

### link

    void link(<Object> attr, <String> text)

Renders an x/html link tag

Parameters:

`attr` - An object containing the link attributes

`text` - The text to appear as link

### linkAsString

    String linkAsString(<Object> attr, <String> text)

Returns a rendered x/html link tag

Parameters:

`attr` - An object containing the link attributes

`text` - The text to appear as link

Returns:

The rendered link tag

See:

- link()

### map

    void map(<String> name, <Array> param)

Renders an image map based on an array containing the map parameters.

Parameters:

`name` - The name of the image map

`param` - An array containing objects, where each of them contains the attributes for a single image map entry

### mapAsString

    String mapAsString(<String> name, <Array> areas)

Returns a rendered image map based on an array containing the map parameters.

Parameters:

`name` - The name of the image map

`areas` - An array containing objects, where each of them contains the attributes for a single image map entry

Returns:

The rendered image map

See:

- map()

### openLink

    void openLink(<Object> attr)

Renders an x/html opening link tag

Parameters:

`attr` - An object containing the tag attributes

### openLinkAsString

    String openLinkAsString(<Object> attr)

Returns an x/html opening link tag

Parameters:

`attr` - An object containing the tag attributes

Returns:

The rendered open link tag

See:

- openTag()

### openTag

    void openTag(<String> name, <Object> attr)

Renders the opening tag of an arbitrary x/html tag

Parameters:

`name` - The tag name

`attr` - An optional object containing element attributes

### openTagAsString

    String openTagAsString(<String> name, <Object> attr)

Returns the opening tag of an arbitrary x/html tag

Parameters:

`name` - The tag name

`attr` - An optional object containing element attributes

Returns:

The rendered x/html opening tag

See:

- openTag()

### password

    void password(<Object> attr)

Renders an x/html password input tag

Parameters:

`attr` - An object containing the tag attributes

### passwordAsString

    String passwordAsString(<Object> attr)

Returns a rendered x/html password input tag

Parameters:

`attr` - An object containing the tag attributes

Returns:

The rendered password input tag

See:

- password()

### radioButton

    void radioButton(<Object> param)

Renders an x/html radiobutton input tag

Parameters:

`param` - An object containing the tag attributes

### radioButtonAsString

    String radioButtonAsString(<Object> attr)

Returns a rendered x/html radio input tag

Parameters:

`attr` - An object containing the tag attributes

Returns:

The rendered element

See:

- radioButton()

### submit

    void submit(<Object> param)

Renders an x/html submit input tag

Parameters:

`param` - An object containing the tag attributes

### submitAsString

    String submitAsString(<Object> attr)

Returns a rendered x/html submit input tag

Parameters:

`attr` - An object containing the tag attributes

Returns:

The rendered submit input tag

See:

- submit()

### table

    void table(<Array> headers, <Array> data, <Object> param)

Renders a complete x/html table.

Parameters:

`headers` - An array containing table headers

`data` - A two-dimensional array containing the table data

`param` - An object containing the following properties:

- `table`: Attributes to render within the opening `<table>` tag
- `tr`: Attributes to render within each `<tr>` tag
- `td`: Attributes to render within each `<td>` tag
- `th`: Attributes to render within each `<th>` tag
- `trHead`: Attributes to render within each `<tr>` tag in the header area of the table
- `trEven`: Attributes to render within each even `<tr>` tag
- `trOdd`: Attributes to render within each odd `<tr>` tag
- `tdEven`: Attributes to render within each even `<td>` tag
- `tdOdd`: Attributes to render within each odd `<td>` tag
- `thEven`: Attributes to render within each even `<th>` tag
- `thOdd`: Attributes to render within each odd `<th>` tag

### tableAsString

    String tableAsString(<Array> headers, <Array> data, <Object> attr)

Returns a rendered x/html table

Parameters:

`headers` - An array containing table headers

`data` - A two-dimensional array containing the table data

`attr` - For a description see table()

Returns:

The rendered table

See:

- table()

### tag

    void tag(<String> name, <Object> attr)

Renders an empty arbitrary x/html tag ("contentless tag")

Parameters:

`name` - The tag name

`attr` - An optional object containing tag attributes

### tagAsString

    String tagAsString(<String> name, <Object> attr)

Returns an empty arbitrary x/html tag ("contentless tag")

Parameters:

`name` - The tag name

`attr` - An optional object containing tag attributes

Returns:

The rendered element

See:

- tag()

### textArea

    void textArea(<Object> param)

Renders an x/html textarea tag

Parameters:

`param` - An object containing the tag attributes

### textAreaAsString

    String textAreaAsString(<Object> attr)

Returns a rendered x/html textarea tag

Parameters:

`attr` - An object containing the tag attributes

Returns:

The rendered textarea tag

See:

- textArea()

### isSelected

    <static> Boolean isSelected(<String> value, <String|Array> selectedValue)

Static helper method used in helma.Html.checkBox and helma.Html.dropDown to check if a current value matches against one or more selected values passed as argument

Parameters:

`value` - The current value to check

`selectedValue` - Either a single value to check against the current value, or an array containing values.

Returns:

True in case the value is among the selected values, false otherwise

### renderMarkupPart

    <static> void renderMarkupPart(<String> name, <String> start, <String> end, <Object> attr)

Static helper method that renders an arbitrary markup part.

Parameters:

`name` - The element's name

`start` - Prefix of each rendered element

`end` - Suffix of each rendered element

`attr` - Optional element attributes

SUMMARY: Constructor | Properties | Methods | DETAIL: Constructor | Properties | Methods

Documentation generated by JSDoc on Thu Apr 5 01:59:00 2007