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()
| Method Detail |
String activateUrls(<String> str)
str - The string wherein URLs should be converted into link tags
void button(<Object> param)
param - An object containing the tag attributes
String buttonAsString(attr)
param - An object containing the tag attributes
void checkBox(<Object> param)
param - An object containing the tag attributes
String checkBoxAsString(<Object> attr)
attr - An object containing the tag attributes
void closeLink()
String closeLinkAsString()
void closeTag(<String> name)
name - The tag name
String closeTagAsString(<String> name)
name - The tag name
void color(<String> c)
c - The color definintion
String colorAsString(<String> c)
c - The color definintion
void dropDown(<Object> param, <Array> options, <String> selectedValue, <String> firstOption)
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)
String dropDownAsString(attr, <Array> options, <String> selectedValue, <String> firstOption)
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
void element(<String> name, <String> str, <Object> attr)
name - The element name
str - The content of the element
attr - An optional object containing element attributes
String elementAsString(<String> name, <String> str, <Object> attr)
name - The element name
str - The content of the element
attr - An optional object containing element attributes
void file(<Object> attr)
attr - An object containing the tag attributes
String fileAsString(<Object> attr)
attr - An object containing the tag attributes
void form(<Object> attr)
attr - An object containing the tag attributes
String formAsString(<Object> attr)
attr - An object containing the tag attributes
void hidden(<Object> param)
param - An object containing the tag attributes
String hiddenAsString(<Object> attr)
attr - An object containing the tag attributes
void input(<Object> param)
param - An object containing the tag attributes
String inputAsString(<Object> attr)
attr - An object containing the tag attributes
void link(<Object> attr, <String> text)
attr - An object containing the link attributes
text - The text to appear as link
String linkAsString(<Object> attr, <String> text)
attr - An object containing the link attributes
text - The text to appear as link
void map(<String> name, <Array> param)
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
String mapAsString(<String> name, <Array> areas)
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
void openLink(<Object> attr)
attr - An object containing the tag attributes
String openLinkAsString(<Object> attr)
attr - An object containing the tag attributes
void openTag(<String> name, <Object> attr)
name - The tag name
attr - An optional object containing element attributes
String openTagAsString(<String> name, <Object> attr)
name - The tag name
attr - An optional object containing element attributes
void password(<Object> attr)
attr - An object containing the tag attributes
String passwordAsString(<Object> attr)
attr - An object containing the tag attributes
void radioButton(<Object> param)
param - An object containing the tag attributes
String radioButtonAsString(<Object> attr)
attr - An object containing the tag attributes
void submit(<Object> param)
param - An object containing the tag attributes
String submitAsString(<Object> attr)
attr - An object containing the tag attributes
void table(<Array> headers, <Array> data, <Object> param)
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> tagtr: Attributes to render within each <tr> tagtd: Attributes to render within each <td> tagth: Attributes to render within each <th> tagtrHead: Attributes to render within each <tr> tag in the header area of the tabletrEven: Attributes to render within each even <tr> tagtrOdd: Attributes to render within each odd <tr> tagtdEven: Attributes to render within each even <td> tagtdOdd: Attributes to render within each odd <td> tagthEven: Attributes to render within each even <th> tagthOdd: Attributes to render within each odd <th> tagString tableAsString(<Array> headers, <Array> data, <Object> attr)
headers - An array containing table headers
data - A two-dimensional array containing the table data
attr - For a description see table()
void tag(<String> name, <Object> attr)
name - The tag name
attr - An optional object containing tag attributes
String tagAsString(<String> name, <Object> attr)
name - The tag name
attr - An optional object containing tag attributes
void textArea(<Object> param)
param - An object containing the tag attributes
String textAreaAsString(<Object> attr)
attr - An object containing the tag attributes
<static> Boolean isSelected(<String> value, <String|Array> selectedValue)
value - The current value to check
selectedValue - Either a single value to check against the current value, or an array containing values.
<static> void renderMarkupPart(<String> name, <String> start, <String> end, <Object> attr)
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 |