if (f.isDisplayOnly()) {
sb.append(htmlVal);
} else if (textElement.isReadOnly()) {
appendReadOnly(htmlVal, sb);
} else {
PopupData popupData = textElement.getPopupData();
String cId = String.valueOf(textElement.hashCode());
sb.append("<input type=\"text\" id=\"").append(textElement.getName())
.append("\" name=\"").append(textElement.getName())
.append("\" value=\"").append(htmlVal).append("\" size=\"").append(textElement.getSize()).append("\" maxlength=\"")
.append(textElement.getMaxLength()).append("\" ")
.append("onkeypress=\"return setFormDirty('").append(JSFORMID).append(f.hashCode()).append("')\" ")
.append("onclick=\"return setFormDirty('").append(JSFORMID).append(f.hashCode()).append("')\" ").append("id=\"")
.append(JSELEMENTID).append(cId).append("\" />");
if (textElement.isUseDateChooser()) {
// date chooser button
sb.append("<span class=\"b_form_datechooser\" id=\"trigger_").append(textElement.getName()).append("\" title=\"").append(StringEscapeUtils.escapeHtml(f.getTranslator().translate("calendar.choose"))).append("\"> </span>");
// date chooser javascript
sb.append("<script type=\"text/javascript\">").append("Calendar.setup({").append("inputField:\"").append(textElement.getName()).append("\",").append("ifFormat:\"");
if (textElement.getDateChooserDateFormat() == null) {
// use default format from default locale file
Formatter formatter = Formatter.getInstance(f.getTranslator().getLocale());
if (textElement.isDateChooserTimeEnabled()) sb.append(formatter.getSimpleDatePatternForDateAndTime());
else sb.append(formatter.getSimpleDatePatternForDate());
} else {
// use custom date format
sb.append(textElement.getDateChooserDateFormat());
}
sb.append("\",").append("button:\"trigger_").append(textElement.getName()).append("\",").append("align:\"Tl\",").append(
"singleClick:false,");
if (textElement.isDateChooserTimeEnabled()) {
sb.append("showsTime:true,");
sb.append("timeFormat:\"24\",");
}
sb.append("cache:true,").append("firstDay:1,").append("showOthers:true,");
// Call on change method on input field to trigger dirty button
sb.append("onUpdate:function(){setFormDirty('").append(JSFORMID).append(f.hashCode()).append("')}");
// Finish js code
sb.append("});").append("</script>");
}
if (popupData != null) {
String text = StringEscapeUtils.escapeHtml(f.getTranslator().translate(popupData.getButtonlabelkey()));
// javascript:{win=window.open('../media/script/Popup/06_01Strassen.html?olatraw=true','webclass_popup','toolbar=no,location=no,directories=0,status=no,menubar=0,scrollbars=yes,resizable=yes,width=650,height=550');win.focus();}
sb.append("<a href=\"javascript:{win=window.open('");
ubu.buildURI(sb, new String[] { Form.ELEM_BUTTON_COMMAND_ID }, new String[] { popupData.getButtonaction() });
sb.append("','olatpopup','toolbar=no,location=no,directories=0,status=no,menubar=0,scrollbars=yes,resizable=yes,width=")
.append(popupData.getPopupwidth()).append(",height=").append(popupData.getPopupheight())
.append("');win.focus();}\" title=\"").append(text).append("\" class=\"b_form_genericchooser\"></a>");
}
}
}