'
out << '
'
out << description
out << '
'
out << '
'
// add help content if it is available
if (helpText.size() > 0) {
out << '
'
out << ' ' + helpText
out << '
'
}
out << '
'
}
/**
* render an ajaxButtonElement
* @param Map attrs
* @param Closure body (help text)
*/
def ajaxButtonElement = { attrs, body ->
baseElement.call(
'ajaxButton',
attrs,
body
)
}
/**
* render a textFieldElement
* @param Map attrs
* @param Closure body (help text)
*/
def textFieldElement = {attrs, body ->
// set default size, or scale to max length if it is less than the default size
if (!attrs.get("size")) {
if (attrs.get("maxlength")) {
attrs.size = ((attrs.get("maxlength") as int) > defaultTextFieldSize) ? defaultTextFieldSize : attrs.get("maxlength")
} else {
attrs.size = defaultTextFieldSize
}
}
// render template element
baseElement.call(
'textField',
attrs,
body
)
}
/**
* render a select form element
* @param Map attrs
* @param Closure body (help text)
*/
def selectElement = {attrs, body ->
baseElement.call(
'select',
attrs,
body
)
}
/**
* render a checkBox form element
* @param Map attrs
* @param Closure body (help text)
*/
def checkBoxElement = {attrs, body ->
baseElement.call(
'checkBox',
attrs,
body
)
}
/**
* render a dateElement
* NOTE: datepicker is attached through wizard.js!
* @param Map attrs
* @param Closure body (help text)
*/
def dateElement = {attrs, body ->
// transform value?
if (attrs.value instanceof Date) {
// transform date instance to formatted string (dd/mm/yyyy)
attrs.value = String.format('%td/%