@Test public void dateTimeMacroRendered(@Mocked ModelFormField.DateTimeField dateTimeField) throws IOException { new Expectations() { { modelFormField.getEntry(withNotNull(), anyString); result = "2020-01-02"; dateTimeField.getInputMethod(); result = "date"; modelFormField.getTooltip(withNotNull()); result = ""; } }; macroFormRenderer.renderDateTimeField(appendable, ImmutableMap.of(), dateTimeField); assertAndGetMacroString("renderDateTimeField", ImmutableMap.of("value", "2020-01-02")); }
@Override public void renderDateTimeField(Appendable writer, Map<String, Object> context, DateTimeField dateTimeField) throws IOException { ModelFormField modelFormField = dateTimeField.getModelFormField(); String paramName = modelFormField.getParameterName(context); String defaultDateTimeString = dateTimeField.getDefaultDateTimeString(context); boolean disabled = modelFormField.getDisabled(); String className = ""; String alert = "false"; String name = ""; String formattedMask = ""; String event = modelFormField.getEvent(); String action = modelFormField.getAction(context); if (UtilValidate.isNotEmpty(modelFormField.getWidgetStyle())) { className = modelFormField.getWidgetStyle(); if (modelFormField.shouldBeRed(context)) { alert = "true"; } } boolean useTimeDropDown = "time-dropdown".equals(dateTimeField.getInputMethod()); String stepString = dateTimeField.getStep(); int step = 1; StringBuilder timeValues = new StringBuilder(); if (useTimeDropDown && UtilValidate.isNotEmpty(step)) { try { step = Integer.parseInt(stepString); } catch (IllegalArgumentException e) { Debug.logWarning("Invalid value for step property for field[" + paramName + "] with input-method=\"time-dropdown\" " + " Found Value [" + stepString + "] " + e.getMessage(), MODULE); } timeValues.append("["); for (int i = 0; i <= 59;) { if (i != 0) { timeValues.append(", "); } timeValues.append(i); i += step; } timeValues.append("]"); } Map<String, String> uiLabelMap = UtilGenerics.cast(context.get("uiLabelMap")); if (uiLabelMap == null) { Debug.logWarning("Could not find uiLabelMap in context", MODULE); } String localizedInputTitle = ""; String localizedIconTitle = ""; boolean shortDateInput = ("date".equals(dateTimeField.getType()) || useTimeDropDown ? true : false); if (useTimeDropDown) { name = UtilHttp.makeCompositeParam(paramName, "date"); } else { name = paramName; } int size = 25; int maxlength = 30; if (shortDateInput) { maxlength = 10; size = maxlength; if (uiLabelMap != null) { localizedInputTitle = uiLabelMap.get("CommonFormatDate"); } } else if ("time".equals(dateTimeField.getType())) { maxlength = 8; size = maxlength; if (uiLabelMap != null) { localizedInputTitle = uiLabelMap.get("CommonFormatTime"); } } else { if (uiLabelMap != null) { localizedInputTitle = uiLabelMap.get("CommonFormatDateTime"); } } ModelFormFieldBuilder builder = new ModelFormFieldBuilder(modelFormField); boolean memEncodeOutput = modelFormField.getEncodeOutput(); if (useTimeDropDown) { builder.setEncodeOutput(false); } if (useTimeDropDown) { builder.setEncodeOutput(memEncodeOutput); } modelFormField = builder.build(); String contextValue = modelFormField.getEntry(context, dateTimeField.getDefaultValue(context)); String value = contextValue; if (UtilValidate.isNotEmpty(value)) { if (value.length() > maxlength) { value = value.substring(0, maxlength); } } String id = modelFormField.getCurrentContainerId(context); ModelForm modelForm = modelFormField.getModelForm(); String formName = FormRenderer.getCurrentFormName(modelForm, context); String timeDropdown = dateTimeField.getInputMethod(); String timeDropdownParamName = ""; String classString = ""; boolean isTwelveHour = false; String timeHourName = ""; int hour2 = 0; int hour1 = 0; int minutes = 0; String timeMinutesName = ""; String amSelected = ""; String pmSelected = ""; String ampmName = ""; String compositeType = ""; if (uiLabelMap != null) { localizedIconTitle = uiLabelMap.get("CommonViewCalendar"); } if (!"time".equals(dateTimeField.getType())) { String tempParamName; if (useTimeDropDown) { tempParamName = UtilHttp.makeCompositeParam(paramName, "date"); } else { tempParamName = paramName; } timeDropdownParamName = tempParamName; defaultDateTimeString = UtilHttp.encodeBlanks(modelFormField.getEntry(context, defaultDateTimeString)); } if (useTimeDropDown) { className = modelFormField.getWidgetStyle(); classString = (className != null ? className : ""); isTwelveHour = "12".equals(dateTimeField.getClock()); Calendar cal = null; try { Timestamp defaultTimestamp = Timestamp.valueOf(contextValue); cal = Calendar.getInstance(); cal.setTime(defaultTimestamp); } catch (IllegalArgumentException e) { Debug.logWarning("Form widget field [" + paramName + "] with input-method=\"time-dropdown\" was not able to understand the default time [" + defaultDateTimeString + "]. The parsing error was: " + e.getMessage(), MODULE); } timeHourName = UtilHttp.makeCompositeParam(paramName, "hour"); if (cal != null) { int hour = cal.get(Calendar.HOUR_OF_DAY); hour2 = hour; if (hour == 0) { hour = 12; } if (hour > 12) { hour -= 12; } hour1 = hour; minutes = cal.get(Calendar.MINUTE); } timeMinutesName = UtilHttp.makeCompositeParam(paramName, "minutes"); compositeType = UtilHttp.makeCompositeParam(paramName, "compositeType"); if (isTwelveHour) { amSelected = ((cal != null && cal.get(Calendar.AM_PM) == Calendar.AM) ? "selected" : ""); pmSelected = ((cal != null && cal.get(Calendar.AM_PM) == Calendar.PM) ? "selected" : ""); ampmName = UtilHttp.makeCompositeParam(paramName, "ampm"); } } if ("single".equals(modelFormField.getModelForm().getType()) && modelFormField.getRequiredField()) { String requiredStyle = modelFormField.getRequiredFieldStyle(); if (UtilValidate.isEmpty(requiredStyle)) { requiredStyle = "required"; } if (UtilValidate.isEmpty(className)) { className = requiredStyle; } else { className = requiredStyle + " " + className; } } String mask = dateTimeField.getMask(); if ("Y".equals(mask)) { if ("date".equals(dateTimeField.getType())) { formattedMask = "9999-99-99"; } else if ("time".equals(dateTimeField.getType())) { formattedMask = "99:99:99"; } else if ("timestamp".equals(dateTimeField.getType())) { formattedMask = "9999-99-99 99:99:99"; } } String tabindex = modelFormField.getTabindex(); StringWriter sr = new StringWriter(); sr.append("<@renderDateTimeField "); sr.append("name=\""); sr.append(name); sr.append("\" className=\""); sr.append(className); sr.append("\" alert=\""); sr.append(alert); sr.append("\" value=\""); sr.append(value); sr.append("\" title=\""); sr.append(localizedInputTitle); sr.append("\" size=\""); sr.append(Integer.toString(size)); sr.append("\" maxlength=\""); sr.append(Integer.toString(maxlength)); sr.append("\" step=\""); sr.append(Integer.toString(step)); sr.append("\" timeValues=\""); sr.append(timeValues.toString()); sr.append("\" id=\""); sr.append(id); sr.append("\" event=\""); sr.append(event); sr.append("\" action=\""); sr.append(action); sr.append("\" dateType=\""); sr.append(dateTimeField.getType()); sr.append("\" shortDateInput="); sr.append(Boolean.toString(shortDateInput)); sr.append(" timeDropdownParamName=\""); sr.append(timeDropdownParamName); sr.append("\" defaultDateTimeString=\""); sr.append(defaultDateTimeString); sr.append("\" localizedIconTitle=\""); sr.append(localizedIconTitle); sr.append("\" timeDropdown=\""); sr.append(timeDropdown); sr.append("\" timeHourName=\""); sr.append(timeHourName); sr.append("\" classString=\""); sr.append(classString); sr.append("\" hour1="); sr.append(Integer.toString(hour1)); sr.append(" hour2="); sr.append(Integer.toString(hour2)); sr.append(" timeMinutesName=\""); sr.append(timeMinutesName); sr.append("\" minutes="); sr.append(Integer.toString(minutes)); sr.append(" isTwelveHour="); sr.append(Boolean.toString(isTwelveHour)); sr.append(" ampmName=\""); sr.append(ampmName); sr.append("\" amSelected=\""); sr.append(amSelected); sr.append("\" pmSelected=\""); sr.append(pmSelected); sr.append("\" compositeType=\""); sr.append(compositeType); sr.append("\" formName=\""); sr.append(formName); sr.append("\" mask=\""); sr.append(formattedMask); sr.append("\" tabindex=\""); sr.append(tabindex); sr.append("\" disabled="); sr.append(Boolean.toString(disabled)); sr.append(" />"); executeMacro(writer, sr.toString()); this.addAsterisks(writer, context, modelFormField); this.appendTooltip(writer, context, modelFormField); }
MacroFormRenderer implements FormStringRenderer { @Override public void renderDateTimeField(Appendable writer, Map<String, Object> context, DateTimeField dateTimeField) throws IOException { ModelFormField modelFormField = dateTimeField.getModelFormField(); String paramName = modelFormField.getParameterName(context); String defaultDateTimeString = dateTimeField.getDefaultDateTimeString(context); boolean disabled = modelFormField.getDisabled(); String className = ""; String alert = "false"; String name = ""; String formattedMask = ""; String event = modelFormField.getEvent(); String action = modelFormField.getAction(context); if (UtilValidate.isNotEmpty(modelFormField.getWidgetStyle())) { className = modelFormField.getWidgetStyle(); if (modelFormField.shouldBeRed(context)) { alert = "true"; } } boolean useTimeDropDown = "time-dropdown".equals(dateTimeField.getInputMethod()); String stepString = dateTimeField.getStep(); int step = 1; StringBuilder timeValues = new StringBuilder(); if (useTimeDropDown && UtilValidate.isNotEmpty(step)) { try { step = Integer.parseInt(stepString); } catch (IllegalArgumentException e) { Debug.logWarning("Invalid value for step property for field[" + paramName + "] with input-method=\"time-dropdown\" " + " Found Value [" + stepString + "] " + e.getMessage(), MODULE); } timeValues.append("["); for (int i = 0; i <= 59;) { if (i != 0) { timeValues.append(", "); } timeValues.append(i); i += step; } timeValues.append("]"); } Map<String, String> uiLabelMap = UtilGenerics.cast(context.get("uiLabelMap")); if (uiLabelMap == null) { Debug.logWarning("Could not find uiLabelMap in context", MODULE); } String localizedInputTitle = ""; String localizedIconTitle = ""; boolean shortDateInput = ("date".equals(dateTimeField.getType()) || useTimeDropDown ? true : false); if (useTimeDropDown) { name = UtilHttp.makeCompositeParam(paramName, "date"); } else { name = paramName; } int size = 25; int maxlength = 30; if (shortDateInput) { maxlength = 10; size = maxlength; if (uiLabelMap != null) { localizedInputTitle = uiLabelMap.get("CommonFormatDate"); } } else if ("time".equals(dateTimeField.getType())) { maxlength = 8; size = maxlength; if (uiLabelMap != null) { localizedInputTitle = uiLabelMap.get("CommonFormatTime"); } } else { if (uiLabelMap != null) { localizedInputTitle = uiLabelMap.get("CommonFormatDateTime"); } } ModelFormFieldBuilder builder = new ModelFormFieldBuilder(modelFormField); boolean memEncodeOutput = modelFormField.getEncodeOutput(); if (useTimeDropDown) { builder.setEncodeOutput(false); } if (useTimeDropDown) { builder.setEncodeOutput(memEncodeOutput); } modelFormField = builder.build(); String contextValue = modelFormField.getEntry(context, dateTimeField.getDefaultValue(context)); String value = contextValue; if (UtilValidate.isNotEmpty(value)) { if (value.length() > maxlength) { value = value.substring(0, maxlength); } } String id = modelFormField.getCurrentContainerId(context); ModelForm modelForm = modelFormField.getModelForm(); String formName = FormRenderer.getCurrentFormName(modelForm, context); String timeDropdown = dateTimeField.getInputMethod(); String timeDropdownParamName = ""; String classString = ""; boolean isTwelveHour = false; String timeHourName = ""; int hour2 = 0; int hour1 = 0; int minutes = 0; String timeMinutesName = ""; String amSelected = ""; String pmSelected = ""; String ampmName = ""; String compositeType = ""; if (uiLabelMap != null) { localizedIconTitle = uiLabelMap.get("CommonViewCalendar"); } if (!"time".equals(dateTimeField.getType())) { String tempParamName; if (useTimeDropDown) { tempParamName = UtilHttp.makeCompositeParam(paramName, "date"); } else { tempParamName = paramName; } timeDropdownParamName = tempParamName; defaultDateTimeString = UtilHttp.encodeBlanks(modelFormField.getEntry(context, defaultDateTimeString)); } if (useTimeDropDown) { className = modelFormField.getWidgetStyle(); classString = (className != null ? className : ""); isTwelveHour = "12".equals(dateTimeField.getClock()); Calendar cal = null; try { Timestamp defaultTimestamp = Timestamp.valueOf(contextValue); cal = Calendar.getInstance(); cal.setTime(defaultTimestamp); } catch (IllegalArgumentException e) { Debug.logWarning("Form widget field [" + paramName + "] with input-method=\"time-dropdown\" was not able to understand the default time [" + defaultDateTimeString + "]. The parsing error was: " + e.getMessage(), MODULE); } timeHourName = UtilHttp.makeCompositeParam(paramName, "hour"); if (cal != null) { int hour = cal.get(Calendar.HOUR_OF_DAY); hour2 = hour; if (hour == 0) { hour = 12; } if (hour > 12) { hour -= 12; } hour1 = hour; minutes = cal.get(Calendar.MINUTE); } timeMinutesName = UtilHttp.makeCompositeParam(paramName, "minutes"); compositeType = UtilHttp.makeCompositeParam(paramName, "compositeType"); if (isTwelveHour) { amSelected = ((cal != null && cal.get(Calendar.AM_PM) == Calendar.AM) ? "selected" : ""); pmSelected = ((cal != null && cal.get(Calendar.AM_PM) == Calendar.PM) ? "selected" : ""); ampmName = UtilHttp.makeCompositeParam(paramName, "ampm"); } } if ("single".equals(modelFormField.getModelForm().getType()) && modelFormField.getRequiredField()) { String requiredStyle = modelFormField.getRequiredFieldStyle(); if (UtilValidate.isEmpty(requiredStyle)) { requiredStyle = "required"; } if (UtilValidate.isEmpty(className)) { className = requiredStyle; } else { className = requiredStyle + " " + className; } } String mask = dateTimeField.getMask(); if ("Y".equals(mask)) { if ("date".equals(dateTimeField.getType())) { formattedMask = "9999-99-99"; } else if ("time".equals(dateTimeField.getType())) { formattedMask = "99:99:99"; } else if ("timestamp".equals(dateTimeField.getType())) { formattedMask = "9999-99-99 99:99:99"; } } String tabindex = modelFormField.getTabindex(); StringWriter sr = new StringWriter(); sr.append("<@renderDateTimeField "); sr.append("name=\""); sr.append(name); sr.append("\" className=\""); sr.append(className); sr.append("\" alert=\""); sr.append(alert); sr.append("\" value=\""); sr.append(value); sr.append("\" title=\""); sr.append(localizedInputTitle); sr.append("\" size=\""); sr.append(Integer.toString(size)); sr.append("\" maxlength=\""); sr.append(Integer.toString(maxlength)); sr.append("\" step=\""); sr.append(Integer.toString(step)); sr.append("\" timeValues=\""); sr.append(timeValues.toString()); sr.append("\" id=\""); sr.append(id); sr.append("\" event=\""); sr.append(event); sr.append("\" action=\""); sr.append(action); sr.append("\" dateType=\""); sr.append(dateTimeField.getType()); sr.append("\" shortDateInput="); sr.append(Boolean.toString(shortDateInput)); sr.append(" timeDropdownParamName=\""); sr.append(timeDropdownParamName); sr.append("\" defaultDateTimeString=\""); sr.append(defaultDateTimeString); sr.append("\" localizedIconTitle=\""); sr.append(localizedIconTitle); sr.append("\" timeDropdown=\""); sr.append(timeDropdown); sr.append("\" timeHourName=\""); sr.append(timeHourName); sr.append("\" classString=\""); sr.append(classString); sr.append("\" hour1="); sr.append(Integer.toString(hour1)); sr.append(" hour2="); sr.append(Integer.toString(hour2)); sr.append(" timeMinutesName=\""); sr.append(timeMinutesName); sr.append("\" minutes="); sr.append(Integer.toString(minutes)); sr.append(" isTwelveHour="); sr.append(Boolean.toString(isTwelveHour)); sr.append(" ampmName=\""); sr.append(ampmName); sr.append("\" amSelected=\""); sr.append(amSelected); sr.append("\" pmSelected=\""); sr.append(pmSelected); sr.append("\" compositeType=\""); sr.append(compositeType); sr.append("\" formName=\""); sr.append(formName); sr.append("\" mask=\""); sr.append(formattedMask); sr.append("\" tabindex=\""); sr.append(tabindex); sr.append("\" disabled="); sr.append(Boolean.toString(disabled)); sr.append(" />"); executeMacro(writer, sr.toString()); this.addAsterisks(writer, context, modelFormField); this.appendTooltip(writer, context, modelFormField); } }
MacroFormRenderer implements FormStringRenderer { @Override public void renderDateTimeField(Appendable writer, Map<String, Object> context, DateTimeField dateTimeField) throws IOException { ModelFormField modelFormField = dateTimeField.getModelFormField(); String paramName = modelFormField.getParameterName(context); String defaultDateTimeString = dateTimeField.getDefaultDateTimeString(context); boolean disabled = modelFormField.getDisabled(); String className = ""; String alert = "false"; String name = ""; String formattedMask = ""; String event = modelFormField.getEvent(); String action = modelFormField.getAction(context); if (UtilValidate.isNotEmpty(modelFormField.getWidgetStyle())) { className = modelFormField.getWidgetStyle(); if (modelFormField.shouldBeRed(context)) { alert = "true"; } } boolean useTimeDropDown = "time-dropdown".equals(dateTimeField.getInputMethod()); String stepString = dateTimeField.getStep(); int step = 1; StringBuilder timeValues = new StringBuilder(); if (useTimeDropDown && UtilValidate.isNotEmpty(step)) { try { step = Integer.parseInt(stepString); } catch (IllegalArgumentException e) { Debug.logWarning("Invalid value for step property for field[" + paramName + "] with input-method=\"time-dropdown\" " + " Found Value [" + stepString + "] " + e.getMessage(), MODULE); } timeValues.append("["); for (int i = 0; i <= 59;) { if (i != 0) { timeValues.append(", "); } timeValues.append(i); i += step; } timeValues.append("]"); } Map<String, String> uiLabelMap = UtilGenerics.cast(context.get("uiLabelMap")); if (uiLabelMap == null) { Debug.logWarning("Could not find uiLabelMap in context", MODULE); } String localizedInputTitle = ""; String localizedIconTitle = ""; boolean shortDateInput = ("date".equals(dateTimeField.getType()) || useTimeDropDown ? true : false); if (useTimeDropDown) { name = UtilHttp.makeCompositeParam(paramName, "date"); } else { name = paramName; } int size = 25; int maxlength = 30; if (shortDateInput) { maxlength = 10; size = maxlength; if (uiLabelMap != null) { localizedInputTitle = uiLabelMap.get("CommonFormatDate"); } } else if ("time".equals(dateTimeField.getType())) { maxlength = 8; size = maxlength; if (uiLabelMap != null) { localizedInputTitle = uiLabelMap.get("CommonFormatTime"); } } else { if (uiLabelMap != null) { localizedInputTitle = uiLabelMap.get("CommonFormatDateTime"); } } ModelFormFieldBuilder builder = new ModelFormFieldBuilder(modelFormField); boolean memEncodeOutput = modelFormField.getEncodeOutput(); if (useTimeDropDown) { builder.setEncodeOutput(false); } if (useTimeDropDown) { builder.setEncodeOutput(memEncodeOutput); } modelFormField = builder.build(); String contextValue = modelFormField.getEntry(context, dateTimeField.getDefaultValue(context)); String value = contextValue; if (UtilValidate.isNotEmpty(value)) { if (value.length() > maxlength) { value = value.substring(0, maxlength); } } String id = modelFormField.getCurrentContainerId(context); ModelForm modelForm = modelFormField.getModelForm(); String formName = FormRenderer.getCurrentFormName(modelForm, context); String timeDropdown = dateTimeField.getInputMethod(); String timeDropdownParamName = ""; String classString = ""; boolean isTwelveHour = false; String timeHourName = ""; int hour2 = 0; int hour1 = 0; int minutes = 0; String timeMinutesName = ""; String amSelected = ""; String pmSelected = ""; String ampmName = ""; String compositeType = ""; if (uiLabelMap != null) { localizedIconTitle = uiLabelMap.get("CommonViewCalendar"); } if (!"time".equals(dateTimeField.getType())) { String tempParamName; if (useTimeDropDown) { tempParamName = UtilHttp.makeCompositeParam(paramName, "date"); } else { tempParamName = paramName; } timeDropdownParamName = tempParamName; defaultDateTimeString = UtilHttp.encodeBlanks(modelFormField.getEntry(context, defaultDateTimeString)); } if (useTimeDropDown) { className = modelFormField.getWidgetStyle(); classString = (className != null ? className : ""); isTwelveHour = "12".equals(dateTimeField.getClock()); Calendar cal = null; try { Timestamp defaultTimestamp = Timestamp.valueOf(contextValue); cal = Calendar.getInstance(); cal.setTime(defaultTimestamp); } catch (IllegalArgumentException e) { Debug.logWarning("Form widget field [" + paramName + "] with input-method=\"time-dropdown\" was not able to understand the default time [" + defaultDateTimeString + "]. The parsing error was: " + e.getMessage(), MODULE); } timeHourName = UtilHttp.makeCompositeParam(paramName, "hour"); if (cal != null) { int hour = cal.get(Calendar.HOUR_OF_DAY); hour2 = hour; if (hour == 0) { hour = 12; } if (hour > 12) { hour -= 12; } hour1 = hour; minutes = cal.get(Calendar.MINUTE); } timeMinutesName = UtilHttp.makeCompositeParam(paramName, "minutes"); compositeType = UtilHttp.makeCompositeParam(paramName, "compositeType"); if (isTwelveHour) { amSelected = ((cal != null && cal.get(Calendar.AM_PM) == Calendar.AM) ? "selected" : ""); pmSelected = ((cal != null && cal.get(Calendar.AM_PM) == Calendar.PM) ? "selected" : ""); ampmName = UtilHttp.makeCompositeParam(paramName, "ampm"); } } if ("single".equals(modelFormField.getModelForm().getType()) && modelFormField.getRequiredField()) { String requiredStyle = modelFormField.getRequiredFieldStyle(); if (UtilValidate.isEmpty(requiredStyle)) { requiredStyle = "required"; } if (UtilValidate.isEmpty(className)) { className = requiredStyle; } else { className = requiredStyle + " " + className; } } String mask = dateTimeField.getMask(); if ("Y".equals(mask)) { if ("date".equals(dateTimeField.getType())) { formattedMask = "9999-99-99"; } else if ("time".equals(dateTimeField.getType())) { formattedMask = "99:99:99"; } else if ("timestamp".equals(dateTimeField.getType())) { formattedMask = "9999-99-99 99:99:99"; } } String tabindex = modelFormField.getTabindex(); StringWriter sr = new StringWriter(); sr.append("<@renderDateTimeField "); sr.append("name=\""); sr.append(name); sr.append("\" className=\""); sr.append(className); sr.append("\" alert=\""); sr.append(alert); sr.append("\" value=\""); sr.append(value); sr.append("\" title=\""); sr.append(localizedInputTitle); sr.append("\" size=\""); sr.append(Integer.toString(size)); sr.append("\" maxlength=\""); sr.append(Integer.toString(maxlength)); sr.append("\" step=\""); sr.append(Integer.toString(step)); sr.append("\" timeValues=\""); sr.append(timeValues.toString()); sr.append("\" id=\""); sr.append(id); sr.append("\" event=\""); sr.append(event); sr.append("\" action=\""); sr.append(action); sr.append("\" dateType=\""); sr.append(dateTimeField.getType()); sr.append("\" shortDateInput="); sr.append(Boolean.toString(shortDateInput)); sr.append(" timeDropdownParamName=\""); sr.append(timeDropdownParamName); sr.append("\" defaultDateTimeString=\""); sr.append(defaultDateTimeString); sr.append("\" localizedIconTitle=\""); sr.append(localizedIconTitle); sr.append("\" timeDropdown=\""); sr.append(timeDropdown); sr.append("\" timeHourName=\""); sr.append(timeHourName); sr.append("\" classString=\""); sr.append(classString); sr.append("\" hour1="); sr.append(Integer.toString(hour1)); sr.append(" hour2="); sr.append(Integer.toString(hour2)); sr.append(" timeMinutesName=\""); sr.append(timeMinutesName); sr.append("\" minutes="); sr.append(Integer.toString(minutes)); sr.append(" isTwelveHour="); sr.append(Boolean.toString(isTwelveHour)); sr.append(" ampmName=\""); sr.append(ampmName); sr.append("\" amSelected=\""); sr.append(amSelected); sr.append("\" pmSelected=\""); sr.append(pmSelected); sr.append("\" compositeType=\""); sr.append(compositeType); sr.append("\" formName=\""); sr.append(formName); sr.append("\" mask=\""); sr.append(formattedMask); sr.append("\" tabindex=\""); sr.append(tabindex); sr.append("\" disabled="); sr.append(Boolean.toString(disabled)); sr.append(" />"); executeMacro(writer, sr.toString()); this.addAsterisks(writer, context, modelFormField); this.appendTooltip(writer, context, modelFormField); } MacroFormRenderer(String macroLibraryPath, HttpServletRequest request, HttpServletResponse response);  MacroFormRenderer(String macroLibraryPath, HttpServletRequest request, HttpServletResponse response,
                             FtlWriter ftlWriter); @Deprecated  MacroFormRenderer(String macroLibraryPath, Appendable writer, HttpServletRequest request, HttpServletResponse response); }
MacroFormRenderer implements FormStringRenderer { @Override public void renderDateTimeField(Appendable writer, Map<String, Object> context, DateTimeField dateTimeField) throws IOException { ModelFormField modelFormField = dateTimeField.getModelFormField(); String paramName = modelFormField.getParameterName(context); String defaultDateTimeString = dateTimeField.getDefaultDateTimeString(context); boolean disabled = modelFormField.getDisabled(); String className = ""; String alert = "false"; String name = ""; String formattedMask = ""; String event = modelFormField.getEvent(); String action = modelFormField.getAction(context); if (UtilValidate.isNotEmpty(modelFormField.getWidgetStyle())) { className = modelFormField.getWidgetStyle(); if (modelFormField.shouldBeRed(context)) { alert = "true"; } } boolean useTimeDropDown = "time-dropdown".equals(dateTimeField.getInputMethod()); String stepString = dateTimeField.getStep(); int step = 1; StringBuilder timeValues = new StringBuilder(); if (useTimeDropDown && UtilValidate.isNotEmpty(step)) { try { step = Integer.parseInt(stepString); } catch (IllegalArgumentException e) { Debug.logWarning("Invalid value for step property for field[" + paramName + "] with input-method=\"time-dropdown\" " + " Found Value [" + stepString + "] " + e.getMessage(), MODULE); } timeValues.append("["); for (int i = 0; i <= 59;) { if (i != 0) { timeValues.append(", "); } timeValues.append(i); i += step; } timeValues.append("]"); } Map<String, String> uiLabelMap = UtilGenerics.cast(context.get("uiLabelMap")); if (uiLabelMap == null) { Debug.logWarning("Could not find uiLabelMap in context", MODULE); } String localizedInputTitle = ""; String localizedIconTitle = ""; boolean shortDateInput = ("date".equals(dateTimeField.getType()) || useTimeDropDown ? true : false); if (useTimeDropDown) { name = UtilHttp.makeCompositeParam(paramName, "date"); } else { name = paramName; } int size = 25; int maxlength = 30; if (shortDateInput) { maxlength = 10; size = maxlength; if (uiLabelMap != null) { localizedInputTitle = uiLabelMap.get("CommonFormatDate"); } } else if ("time".equals(dateTimeField.getType())) { maxlength = 8; size = maxlength; if (uiLabelMap != null) { localizedInputTitle = uiLabelMap.get("CommonFormatTime"); } } else { if (uiLabelMap != null) { localizedInputTitle = uiLabelMap.get("CommonFormatDateTime"); } } ModelFormFieldBuilder builder = new ModelFormFieldBuilder(modelFormField); boolean memEncodeOutput = modelFormField.getEncodeOutput(); if (useTimeDropDown) { builder.setEncodeOutput(false); } if (useTimeDropDown) { builder.setEncodeOutput(memEncodeOutput); } modelFormField = builder.build(); String contextValue = modelFormField.getEntry(context, dateTimeField.getDefaultValue(context)); String value = contextValue; if (UtilValidate.isNotEmpty(value)) { if (value.length() > maxlength) { value = value.substring(0, maxlength); } } String id = modelFormField.getCurrentContainerId(context); ModelForm modelForm = modelFormField.getModelForm(); String formName = FormRenderer.getCurrentFormName(modelForm, context); String timeDropdown = dateTimeField.getInputMethod(); String timeDropdownParamName = ""; String classString = ""; boolean isTwelveHour = false; String timeHourName = ""; int hour2 = 0; int hour1 = 0; int minutes = 0; String timeMinutesName = ""; String amSelected = ""; String pmSelected = ""; String ampmName = ""; String compositeType = ""; if (uiLabelMap != null) { localizedIconTitle = uiLabelMap.get("CommonViewCalendar"); } if (!"time".equals(dateTimeField.getType())) { String tempParamName; if (useTimeDropDown) { tempParamName = UtilHttp.makeCompositeParam(paramName, "date"); } else { tempParamName = paramName; } timeDropdownParamName = tempParamName; defaultDateTimeString = UtilHttp.encodeBlanks(modelFormField.getEntry(context, defaultDateTimeString)); } if (useTimeDropDown) { className = modelFormField.getWidgetStyle(); classString = (className != null ? className : ""); isTwelveHour = "12".equals(dateTimeField.getClock()); Calendar cal = null; try { Timestamp defaultTimestamp = Timestamp.valueOf(contextValue); cal = Calendar.getInstance(); cal.setTime(defaultTimestamp); } catch (IllegalArgumentException e) { Debug.logWarning("Form widget field [" + paramName + "] with input-method=\"time-dropdown\" was not able to understand the default time [" + defaultDateTimeString + "]. The parsing error was: " + e.getMessage(), MODULE); } timeHourName = UtilHttp.makeCompositeParam(paramName, "hour"); if (cal != null) { int hour = cal.get(Calendar.HOUR_OF_DAY); hour2 = hour; if (hour == 0) { hour = 12; } if (hour > 12) { hour -= 12; } hour1 = hour; minutes = cal.get(Calendar.MINUTE); } timeMinutesName = UtilHttp.makeCompositeParam(paramName, "minutes"); compositeType = UtilHttp.makeCompositeParam(paramName, "compositeType"); if (isTwelveHour) { amSelected = ((cal != null && cal.get(Calendar.AM_PM) == Calendar.AM) ? "selected" : ""); pmSelected = ((cal != null && cal.get(Calendar.AM_PM) == Calendar.PM) ? "selected" : ""); ampmName = UtilHttp.makeCompositeParam(paramName, "ampm"); } } if ("single".equals(modelFormField.getModelForm().getType()) && modelFormField.getRequiredField()) { String requiredStyle = modelFormField.getRequiredFieldStyle(); if (UtilValidate.isEmpty(requiredStyle)) { requiredStyle = "required"; } if (UtilValidate.isEmpty(className)) { className = requiredStyle; } else { className = requiredStyle + " " + className; } } String mask = dateTimeField.getMask(); if ("Y".equals(mask)) { if ("date".equals(dateTimeField.getType())) { formattedMask = "9999-99-99"; } else if ("time".equals(dateTimeField.getType())) { formattedMask = "99:99:99"; } else if ("timestamp".equals(dateTimeField.getType())) { formattedMask = "9999-99-99 99:99:99"; } } String tabindex = modelFormField.getTabindex(); StringWriter sr = new StringWriter(); sr.append("<@renderDateTimeField "); sr.append("name=\""); sr.append(name); sr.append("\" className=\""); sr.append(className); sr.append("\" alert=\""); sr.append(alert); sr.append("\" value=\""); sr.append(value); sr.append("\" title=\""); sr.append(localizedInputTitle); sr.append("\" size=\""); sr.append(Integer.toString(size)); sr.append("\" maxlength=\""); sr.append(Integer.toString(maxlength)); sr.append("\" step=\""); sr.append(Integer.toString(step)); sr.append("\" timeValues=\""); sr.append(timeValues.toString()); sr.append("\" id=\""); sr.append(id); sr.append("\" event=\""); sr.append(event); sr.append("\" action=\""); sr.append(action); sr.append("\" dateType=\""); sr.append(dateTimeField.getType()); sr.append("\" shortDateInput="); sr.append(Boolean.toString(shortDateInput)); sr.append(" timeDropdownParamName=\""); sr.append(timeDropdownParamName); sr.append("\" defaultDateTimeString=\""); sr.append(defaultDateTimeString); sr.append("\" localizedIconTitle=\""); sr.append(localizedIconTitle); sr.append("\" timeDropdown=\""); sr.append(timeDropdown); sr.append("\" timeHourName=\""); sr.append(timeHourName); sr.append("\" classString=\""); sr.append(classString); sr.append("\" hour1="); sr.append(Integer.toString(hour1)); sr.append(" hour2="); sr.append(Integer.toString(hour2)); sr.append(" timeMinutesName=\""); sr.append(timeMinutesName); sr.append("\" minutes="); sr.append(Integer.toString(minutes)); sr.append(" isTwelveHour="); sr.append(Boolean.toString(isTwelveHour)); sr.append(" ampmName=\""); sr.append(ampmName); sr.append("\" amSelected=\""); sr.append(amSelected); sr.append("\" pmSelected=\""); sr.append(pmSelected); sr.append("\" compositeType=\""); sr.append(compositeType); sr.append("\" formName=\""); sr.append(formName); sr.append("\" mask=\""); sr.append(formattedMask); sr.append("\" tabindex=\""); sr.append(tabindex); sr.append("\" disabled="); sr.append(Boolean.toString(disabled)); sr.append(" />"); executeMacro(writer, sr.toString()); this.addAsterisks(writer, context, modelFormField); this.appendTooltip(writer, context, modelFormField); } MacroFormRenderer(String macroLibraryPath, HttpServletRequest request, HttpServletResponse response);  MacroFormRenderer(String macroLibraryPath, HttpServletRequest request, HttpServletResponse response,
                             FtlWriter ftlWriter); @Deprecated  MacroFormRenderer(String macroLibraryPath, Appendable writer, HttpServletRequest request, HttpServletResponse response); static String getAjaxParamsFromTarget(String target); boolean getRenderPagination(); void setRenderPagination(boolean renderPagination); void renderLabel(Appendable writer, Map<String, Object> context, ModelScreenWidget.Label label); @Override void renderDisplayField(Appendable writer, Map<String, Object> context, DisplayField displayField); @Override void renderHyperlinkField(Appendable writer, Map<String, Object> context, HyperlinkField hyperlinkField); @Override void renderMenuField(Appendable writer, Map<String, Object> context, MenuField menuField); @Override void renderTextField(Appendable writer, Map<String, Object> context, TextField textField); @Override void renderTextareaField(Appendable writer, Map<String, Object> context, TextareaField textareaField); @Override void renderDateTimeField(Appendable writer, Map<String, Object> context, DateTimeField dateTimeField); @Override void renderDropDownField(Appendable writer, Map<String, Object> context, DropDownField dropDownField); @Override void renderCheckField(Appendable writer, Map<String, Object> context, CheckField checkField); @Override void renderRadioField(Appendable writer, Map<String, Object> context, RadioField radioField); @Override void renderSubmitField(Appendable writer, Map<String, Object> context, SubmitField submitField); @Override void renderResetField(Appendable writer, Map<String, Object> context, ResetField resetField); @Override void renderHiddenField(Appendable writer, Map<String, Object> context, HiddenField hiddenField); @Override void renderHiddenField(Appendable writer, Map<String, Object> context, ModelFormField modelFormField, String value); @Override void renderIgnoredField(Appendable writer, Map<String, Object> context, IgnoredField ignoredField); @Override void renderFieldTitle(Appendable writer, Map<String, Object> context, ModelFormField modelFormField); @Override void renderSingleFormFieldTitle(Appendable writer, Map<String, Object> context, ModelFormField modelFormField); @Override void renderFormOpen(Appendable writer, Map<String, Object> context, ModelForm modelForm); @Override void renderFormClose(Appendable writer, Map<String, Object> context, ModelForm modelForm); @Override void renderMultiFormClose(Appendable writer, Map<String, Object> context, ModelForm modelForm); @Override void renderFormatListWrapperOpen(Appendable writer, Map<String, Object> context, ModelForm modelForm); @Override void renderEmptyFormDataMessage(Appendable writer, Map<String, Object> context, ModelForm modelForm); @Override void renderFormatListWrapperClose(Appendable writer, Map<String, Object> context, ModelForm modelForm); @Override void renderFormatHeaderOpen(Appendable writer, Map<String, Object> context, ModelForm modelForm); @Override void renderFormatHeaderClose(Appendable writer, Map<String, Object> context, ModelForm modelForm); @Override void renderFormatHeaderRowOpen(Appendable writer, Map<String, Object> context, ModelForm modelForm); @Override void renderFormatHeaderRowClose(Appendable writer, Map<String, Object> context, ModelForm modelForm); @Override void renderFormatHeaderRowCellOpen(Appendable writer, Map<String, Object> context, ModelForm modelForm, ModelFormField modelFormField,
                                              int positionSpan); @Override void renderFormatHeaderRowCellClose(Appendable writer, Map<String, Object> context, ModelForm modelForm, ModelFormField modelFormField); @Override void renderFormatHeaderRowFormCellOpen(Appendable writer, Map<String, Object> context, ModelForm modelForm); @Override void renderFormatHeaderRowFormCellClose(Appendable writer, Map<String, Object> context, ModelForm modelForm); @Override void renderFormatHeaderRowFormCellTitleSeparator(Appendable writer, Map<String, Object> context, ModelForm modelForm,
                                                            ModelFormField modelFormField, boolean isLast); @Override void renderFormatItemRowOpen(Appendable writer, Map<String, Object> context, ModelForm modelForm); @Override void renderFormatItemRowClose(Appendable writer, Map<String, Object> context, ModelForm modelForm); @Override void renderFormatItemRowCellOpen(Appendable writer, Map<String, Object> context, ModelForm modelForm, ModelFormField modelFormField,
                                            int positionSpan); @Override void renderFormatItemRowCellClose(Appendable writer, Map<String, Object> context, ModelForm modelForm, ModelFormField modelFormField); @Override void renderFormatItemRowFormCellOpen(Appendable writer, Map<String, Object> context, ModelForm modelForm); @Override void renderFormatItemRowFormCellClose(Appendable writer, Map<String, Object> context, ModelForm modelForm); @Override void renderFormatSingleWrapperOpen(Appendable writer, Map<String, Object> context, ModelForm modelForm); @Override void renderFormatSingleWrapperClose(Appendable writer, Map<String, Object> context, ModelForm modelForm); @Override void renderFormatFieldRowOpen(Appendable writer, Map<String, Object> context, ModelForm modelForm); @Override void renderFormatFieldRowClose(Appendable writer, Map<String, Object> context, ModelForm modelForm); @Override void renderFormatFieldRowTitleCellOpen(Appendable writer, Map<String, Object> context, ModelFormField modelFormField); @Override void renderFormatFieldRowTitleCellClose(Appendable writer, Map<String, Object> context, ModelFormField modelFormField); @Override void renderFormatFieldRowSpacerCell(Appendable writer, Map<String, Object> context, ModelFormField modelFormField); @Override void renderFormatFieldRowWidgetCellOpen(Appendable writer, Map<String, Object> context, ModelFormField modelFormField, int positions,
                                                   int positionSpan, Integer nextPositionInRow); @Override void renderFormatFieldRowWidgetCellClose(Appendable writer, Map<String, Object> context, ModelFormField modelFormField, int positions,
                                                    int positionSpan, Integer nextPositionInRow); @Override void renderFormatEmptySpace(Appendable writer, Map<String, Object> context, ModelForm modelForm); @Override void renderTextFindField(Appendable writer, Map<String, Object> context, TextFindField textFindField); @Override void renderRangeFindField(Appendable writer, Map<String, Object> context, RangeFindField rangeFindField); @Override void renderDateFindField(Appendable writer, Map<String, Object> context, DateFindField dateFindField); @Override void renderLookupField(Appendable writer, Map<String, Object> context, LookupField lookupField); void renderNextPrev(Appendable writer, Map<String, Object> context, ModelForm modelForm); @Override void renderFileField(Appendable writer, Map<String, Object> context, FileField textField); @Override void renderPasswordField(Appendable writer, Map<String, Object> context, PasswordField passwordField); @Override void renderImageField(Appendable writer, Map<String, Object> context, ImageField imageField); @Override void renderFieldGroupOpen(Appendable writer, Map<String, Object> context, ModelForm.FieldGroup fieldGroup); @Override void renderFieldGroupClose(Appendable writer, Map<String, Object> context, ModelForm.FieldGroup fieldGroup); @Override void renderBanner(Appendable writer, Map<String, Object> context, ModelForm.Banner banner); void renderBeginningBoundaryComment(Appendable writer, String widgetType, ModelWidget modelWidget); void renderEndingBoundaryComment(Appendable writer, String widgetType, ModelWidget modelWidget); void renderSortField(Appendable writer, Map<String, Object> context, ModelFormField modelFormField, String titleText); String createAjaxParamsFromUpdateAreas(List<ModelForm.UpdateArea> updateAreas, String extraParams, Map<String, ? extends Object> context); void appendTooltip(Appendable writer, Map<String, Object> context, ModelFormField modelFormField); void makeHyperlinkString(Appendable writer, ModelFormField.SubHyperlink subHyperlink, Map<String, Object> context); void addAsterisks(Appendable writer, Map<String, Object> context, ModelFormField modelFormField); void appendContentUrl(Appendable writer, String location); void makeHyperlinkByType(Appendable writer, String linkType, String linkStyle, String targetType, String target, Map<String,
            String> parameterMap, String description, String targetWindow, String confirmation, ModelFormField modelFormField,
            HttpServletRequest request, HttpServletResponse response, Map<String, Object> context); void makeHyperlinkString(Appendable writer, String linkStyle, String targetType, String target, Map<String, String> parameterMap,
                                    String description, String confirmation, ModelFormField modelFormField, HttpServletRequest request,
                                    HttpServletResponse response, Map<String, Object> context, String targetWindow); void makeHiddenFormLinkAnchor(Appendable writer, String linkStyle, String description, String confirmation, ModelFormField modelFormField,
                                         HttpServletRequest request, HttpServletResponse response, Map<String, Object> context); @Override void renderContainerFindField(Appendable writer, Map<String, Object> context, ContainerField containerField); }
MacroFormRenderer implements FormStringRenderer { @Override public void renderDateTimeField(Appendable writer, Map<String, Object> context, DateTimeField dateTimeField) throws IOException { ModelFormField modelFormField = dateTimeField.getModelFormField(); String paramName = modelFormField.getParameterName(context); String defaultDateTimeString = dateTimeField.getDefaultDateTimeString(context); boolean disabled = modelFormField.getDisabled(); String className = ""; String alert = "false"; String name = ""; String formattedMask = ""; String event = modelFormField.getEvent(); String action = modelFormField.getAction(context); if (UtilValidate.isNotEmpty(modelFormField.getWidgetStyle())) { className = modelFormField.getWidgetStyle(); if (modelFormField.shouldBeRed(context)) { alert = "true"; } } boolean useTimeDropDown = "time-dropdown".equals(dateTimeField.getInputMethod()); String stepString = dateTimeField.getStep(); int step = 1; StringBuilder timeValues = new StringBuilder(); if (useTimeDropDown && UtilValidate.isNotEmpty(step)) { try { step = Integer.parseInt(stepString); } catch (IllegalArgumentException e) { Debug.logWarning("Invalid value for step property for field[" + paramName + "] with input-method=\"time-dropdown\" " + " Found Value [" + stepString + "] " + e.getMessage(), MODULE); } timeValues.append("["); for (int i = 0; i <= 59;) { if (i != 0) { timeValues.append(", "); } timeValues.append(i); i += step; } timeValues.append("]"); } Map<String, String> uiLabelMap = UtilGenerics.cast(context.get("uiLabelMap")); if (uiLabelMap == null) { Debug.logWarning("Could not find uiLabelMap in context", MODULE); } String localizedInputTitle = ""; String localizedIconTitle = ""; boolean shortDateInput = ("date".equals(dateTimeField.getType()) || useTimeDropDown ? true : false); if (useTimeDropDown) { name = UtilHttp.makeCompositeParam(paramName, "date"); } else { name = paramName; } int size = 25; int maxlength = 30; if (shortDateInput) { maxlength = 10; size = maxlength; if (uiLabelMap != null) { localizedInputTitle = uiLabelMap.get("CommonFormatDate"); } } else if ("time".equals(dateTimeField.getType())) { maxlength = 8; size = maxlength; if (uiLabelMap != null) { localizedInputTitle = uiLabelMap.get("CommonFormatTime"); } } else { if (uiLabelMap != null) { localizedInputTitle = uiLabelMap.get("CommonFormatDateTime"); } } ModelFormFieldBuilder builder = new ModelFormFieldBuilder(modelFormField); boolean memEncodeOutput = modelFormField.getEncodeOutput(); if (useTimeDropDown) { builder.setEncodeOutput(false); } if (useTimeDropDown) { builder.setEncodeOutput(memEncodeOutput); } modelFormField = builder.build(); String contextValue = modelFormField.getEntry(context, dateTimeField.getDefaultValue(context)); String value = contextValue; if (UtilValidate.isNotEmpty(value)) { if (value.length() > maxlength) { value = value.substring(0, maxlength); } } String id = modelFormField.getCurrentContainerId(context); ModelForm modelForm = modelFormField.getModelForm(); String formName = FormRenderer.getCurrentFormName(modelForm, context); String timeDropdown = dateTimeField.getInputMethod(); String timeDropdownParamName = ""; String classString = ""; boolean isTwelveHour = false; String timeHourName = ""; int hour2 = 0; int hour1 = 0; int minutes = 0; String timeMinutesName = ""; String amSelected = ""; String pmSelected = ""; String ampmName = ""; String compositeType = ""; if (uiLabelMap != null) { localizedIconTitle = uiLabelMap.get("CommonViewCalendar"); } if (!"time".equals(dateTimeField.getType())) { String tempParamName; if (useTimeDropDown) { tempParamName = UtilHttp.makeCompositeParam(paramName, "date"); } else { tempParamName = paramName; } timeDropdownParamName = tempParamName; defaultDateTimeString = UtilHttp.encodeBlanks(modelFormField.getEntry(context, defaultDateTimeString)); } if (useTimeDropDown) { className = modelFormField.getWidgetStyle(); classString = (className != null ? className : ""); isTwelveHour = "12".equals(dateTimeField.getClock()); Calendar cal = null; try { Timestamp defaultTimestamp = Timestamp.valueOf(contextValue); cal = Calendar.getInstance(); cal.setTime(defaultTimestamp); } catch (IllegalArgumentException e) { Debug.logWarning("Form widget field [" + paramName + "] with input-method=\"time-dropdown\" was not able to understand the default time [" + defaultDateTimeString + "]. The parsing error was: " + e.getMessage(), MODULE); } timeHourName = UtilHttp.makeCompositeParam(paramName, "hour"); if (cal != null) { int hour = cal.get(Calendar.HOUR_OF_DAY); hour2 = hour; if (hour == 0) { hour = 12; } if (hour > 12) { hour -= 12; } hour1 = hour; minutes = cal.get(Calendar.MINUTE); } timeMinutesName = UtilHttp.makeCompositeParam(paramName, "minutes"); compositeType = UtilHttp.makeCompositeParam(paramName, "compositeType"); if (isTwelveHour) { amSelected = ((cal != null && cal.get(Calendar.AM_PM) == Calendar.AM) ? "selected" : ""); pmSelected = ((cal != null && cal.get(Calendar.AM_PM) == Calendar.PM) ? "selected" : ""); ampmName = UtilHttp.makeCompositeParam(paramName, "ampm"); } } if ("single".equals(modelFormField.getModelForm().getType()) && modelFormField.getRequiredField()) { String requiredStyle = modelFormField.getRequiredFieldStyle(); if (UtilValidate.isEmpty(requiredStyle)) { requiredStyle = "required"; } if (UtilValidate.isEmpty(className)) { className = requiredStyle; } else { className = requiredStyle + " " + className; } } String mask = dateTimeField.getMask(); if ("Y".equals(mask)) { if ("date".equals(dateTimeField.getType())) { formattedMask = "9999-99-99"; } else if ("time".equals(dateTimeField.getType())) { formattedMask = "99:99:99"; } else if ("timestamp".equals(dateTimeField.getType())) { formattedMask = "9999-99-99 99:99:99"; } } String tabindex = modelFormField.getTabindex(); StringWriter sr = new StringWriter(); sr.append("<@renderDateTimeField "); sr.append("name=\""); sr.append(name); sr.append("\" className=\""); sr.append(className); sr.append("\" alert=\""); sr.append(alert); sr.append("\" value=\""); sr.append(value); sr.append("\" title=\""); sr.append(localizedInputTitle); sr.append("\" size=\""); sr.append(Integer.toString(size)); sr.append("\" maxlength=\""); sr.append(Integer.toString(maxlength)); sr.append("\" step=\""); sr.append(Integer.toString(step)); sr.append("\" timeValues=\""); sr.append(timeValues.toString()); sr.append("\" id=\""); sr.append(id); sr.append("\" event=\""); sr.append(event); sr.append("\" action=\""); sr.append(action); sr.append("\" dateType=\""); sr.append(dateTimeField.getType()); sr.append("\" shortDateInput="); sr.append(Boolean.toString(shortDateInput)); sr.append(" timeDropdownParamName=\""); sr.append(timeDropdownParamName); sr.append("\" defaultDateTimeString=\""); sr.append(defaultDateTimeString); sr.append("\" localizedIconTitle=\""); sr.append(localizedIconTitle); sr.append("\" timeDropdown=\""); sr.append(timeDropdown); sr.append("\" timeHourName=\""); sr.append(timeHourName); sr.append("\" classString=\""); sr.append(classString); sr.append("\" hour1="); sr.append(Integer.toString(hour1)); sr.append(" hour2="); sr.append(Integer.toString(hour2)); sr.append(" timeMinutesName=\""); sr.append(timeMinutesName); sr.append("\" minutes="); sr.append(Integer.toString(minutes)); sr.append(" isTwelveHour="); sr.append(Boolean.toString(isTwelveHour)); sr.append(" ampmName=\""); sr.append(ampmName); sr.append("\" amSelected=\""); sr.append(amSelected); sr.append("\" pmSelected=\""); sr.append(pmSelected); sr.append("\" compositeType=\""); sr.append(compositeType); sr.append("\" formName=\""); sr.append(formName); sr.append("\" mask=\""); sr.append(formattedMask); sr.append("\" tabindex=\""); sr.append(tabindex); sr.append("\" disabled="); sr.append(Boolean.toString(disabled)); sr.append(" />"); executeMacro(writer, sr.toString()); this.addAsterisks(writer, context, modelFormField); this.appendTooltip(writer, context, modelFormField); } MacroFormRenderer(String macroLibraryPath, HttpServletRequest request, HttpServletResponse response);  MacroFormRenderer(String macroLibraryPath, HttpServletRequest request, HttpServletResponse response,
                             FtlWriter ftlWriter); @Deprecated  MacroFormRenderer(String macroLibraryPath, Appendable writer, HttpServletRequest request, HttpServletResponse response); static String getAjaxParamsFromTarget(String target); boolean getRenderPagination(); void setRenderPagination(boolean renderPagination); void renderLabel(Appendable writer, Map<String, Object> context, ModelScreenWidget.Label label); @Override void renderDisplayField(Appendable writer, Map<String, Object> context, DisplayField displayField); @Override void renderHyperlinkField(Appendable writer, Map<String, Object> context, HyperlinkField hyperlinkField); @Override void renderMenuField(Appendable writer, Map<String, Object> context, MenuField menuField); @Override void renderTextField(Appendable writer, Map<String, Object> context, TextField textField); @Override void renderTextareaField(Appendable writer, Map<String, Object> context, TextareaField textareaField); @Override void renderDateTimeField(Appendable writer, Map<String, Object> context, DateTimeField dateTimeField); @Override void renderDropDownField(Appendable writer, Map<String, Object> context, DropDownField dropDownField); @Override void renderCheckField(Appendable writer, Map<String, Object> context, CheckField checkField); @Override void renderRadioField(Appendable writer, Map<String, Object> context, RadioField radioField); @Override void renderSubmitField(Appendable writer, Map<String, Object> context, SubmitField submitField); @Override void renderResetField(Appendable writer, Map<String, Object> context, ResetField resetField); @Override void renderHiddenField(Appendable writer, Map<String, Object> context, HiddenField hiddenField); @Override void renderHiddenField(Appendable writer, Map<String, Object> context, ModelFormField modelFormField, String value); @Override void renderIgnoredField(Appendable writer, Map<String, Object> context, IgnoredField ignoredField); @Override void renderFieldTitle(Appendable writer, Map<String, Object> context, ModelFormField modelFormField); @Override void renderSingleFormFieldTitle(Appendable writer, Map<String, Object> context, ModelFormField modelFormField); @Override void renderFormOpen(Appendable writer, Map<String, Object> context, ModelForm modelForm); @Override void renderFormClose(Appendable writer, Map<String, Object> context, ModelForm modelForm); @Override void renderMultiFormClose(Appendable writer, Map<String, Object> context, ModelForm modelForm); @Override void renderFormatListWrapperOpen(Appendable writer, Map<String, Object> context, ModelForm modelForm); @Override void renderEmptyFormDataMessage(Appendable writer, Map<String, Object> context, ModelForm modelForm); @Override void renderFormatListWrapperClose(Appendable writer, Map<String, Object> context, ModelForm modelForm); @Override void renderFormatHeaderOpen(Appendable writer, Map<String, Object> context, ModelForm modelForm); @Override void renderFormatHeaderClose(Appendable writer, Map<String, Object> context, ModelForm modelForm); @Override void renderFormatHeaderRowOpen(Appendable writer, Map<String, Object> context, ModelForm modelForm); @Override void renderFormatHeaderRowClose(Appendable writer, Map<String, Object> context, ModelForm modelForm); @Override void renderFormatHeaderRowCellOpen(Appendable writer, Map<String, Object> context, ModelForm modelForm, ModelFormField modelFormField,
                                              int positionSpan); @Override void renderFormatHeaderRowCellClose(Appendable writer, Map<String, Object> context, ModelForm modelForm, ModelFormField modelFormField); @Override void renderFormatHeaderRowFormCellOpen(Appendable writer, Map<String, Object> context, ModelForm modelForm); @Override void renderFormatHeaderRowFormCellClose(Appendable writer, Map<String, Object> context, ModelForm modelForm); @Override void renderFormatHeaderRowFormCellTitleSeparator(Appendable writer, Map<String, Object> context, ModelForm modelForm,
                                                            ModelFormField modelFormField, boolean isLast); @Override void renderFormatItemRowOpen(Appendable writer, Map<String, Object> context, ModelForm modelForm); @Override void renderFormatItemRowClose(Appendable writer, Map<String, Object> context, ModelForm modelForm); @Override void renderFormatItemRowCellOpen(Appendable writer, Map<String, Object> context, ModelForm modelForm, ModelFormField modelFormField,
                                            int positionSpan); @Override void renderFormatItemRowCellClose(Appendable writer, Map<String, Object> context, ModelForm modelForm, ModelFormField modelFormField); @Override void renderFormatItemRowFormCellOpen(Appendable writer, Map<String, Object> context, ModelForm modelForm); @Override void renderFormatItemRowFormCellClose(Appendable writer, Map<String, Object> context, ModelForm modelForm); @Override void renderFormatSingleWrapperOpen(Appendable writer, Map<String, Object> context, ModelForm modelForm); @Override void renderFormatSingleWrapperClose(Appendable writer, Map<String, Object> context, ModelForm modelForm); @Override void renderFormatFieldRowOpen(Appendable writer, Map<String, Object> context, ModelForm modelForm); @Override void renderFormatFieldRowClose(Appendable writer, Map<String, Object> context, ModelForm modelForm); @Override void renderFormatFieldRowTitleCellOpen(Appendable writer, Map<String, Object> context, ModelFormField modelFormField); @Override void renderFormatFieldRowTitleCellClose(Appendable writer, Map<String, Object> context, ModelFormField modelFormField); @Override void renderFormatFieldRowSpacerCell(Appendable writer, Map<String, Object> context, ModelFormField modelFormField); @Override void renderFormatFieldRowWidgetCellOpen(Appendable writer, Map<String, Object> context, ModelFormField modelFormField, int positions,
                                                   int positionSpan, Integer nextPositionInRow); @Override void renderFormatFieldRowWidgetCellClose(Appendable writer, Map<String, Object> context, ModelFormField modelFormField, int positions,
                                                    int positionSpan, Integer nextPositionInRow); @Override void renderFormatEmptySpace(Appendable writer, Map<String, Object> context, ModelForm modelForm); @Override void renderTextFindField(Appendable writer, Map<String, Object> context, TextFindField textFindField); @Override void renderRangeFindField(Appendable writer, Map<String, Object> context, RangeFindField rangeFindField); @Override void renderDateFindField(Appendable writer, Map<String, Object> context, DateFindField dateFindField); @Override void renderLookupField(Appendable writer, Map<String, Object> context, LookupField lookupField); void renderNextPrev(Appendable writer, Map<String, Object> context, ModelForm modelForm); @Override void renderFileField(Appendable writer, Map<String, Object> context, FileField textField); @Override void renderPasswordField(Appendable writer, Map<String, Object> context, PasswordField passwordField); @Override void renderImageField(Appendable writer, Map<String, Object> context, ImageField imageField); @Override void renderFieldGroupOpen(Appendable writer, Map<String, Object> context, ModelForm.FieldGroup fieldGroup); @Override void renderFieldGroupClose(Appendable writer, Map<String, Object> context, ModelForm.FieldGroup fieldGroup); @Override void renderBanner(Appendable writer, Map<String, Object> context, ModelForm.Banner banner); void renderBeginningBoundaryComment(Appendable writer, String widgetType, ModelWidget modelWidget); void renderEndingBoundaryComment(Appendable writer, String widgetType, ModelWidget modelWidget); void renderSortField(Appendable writer, Map<String, Object> context, ModelFormField modelFormField, String titleText); String createAjaxParamsFromUpdateAreas(List<ModelForm.UpdateArea> updateAreas, String extraParams, Map<String, ? extends Object> context); void appendTooltip(Appendable writer, Map<String, Object> context, ModelFormField modelFormField); void makeHyperlinkString(Appendable writer, ModelFormField.SubHyperlink subHyperlink, Map<String, Object> context); void addAsterisks(Appendable writer, Map<String, Object> context, ModelFormField modelFormField); void appendContentUrl(Appendable writer, String location); void makeHyperlinkByType(Appendable writer, String linkType, String linkStyle, String targetType, String target, Map<String,
            String> parameterMap, String description, String targetWindow, String confirmation, ModelFormField modelFormField,
            HttpServletRequest request, HttpServletResponse response, Map<String, Object> context); void makeHyperlinkString(Appendable writer, String linkStyle, String targetType, String target, Map<String, String> parameterMap,
                                    String description, String confirmation, ModelFormField modelFormField, HttpServletRequest request,
                                    HttpServletResponse response, Map<String, Object> context, String targetWindow); void makeHiddenFormLinkAnchor(Appendable writer, String linkStyle, String description, String confirmation, ModelFormField modelFormField,
                                         HttpServletRequest request, HttpServletResponse response, Map<String, Object> context); @Override void renderContainerFindField(Appendable writer, Map<String, Object> context, ContainerField containerField);  }