Fixed issues with new renderers when a link was inserted in the form title. Thanks to Divesh Dutta for the bug report and partial fix.

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@792470 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Jacopo Cappellato
2009-07-09 09:20:07 +00:00
parent bf54457dcc
commit d797f8fb8d
5 changed files with 17 additions and 8 deletions
@@ -2448,8 +2448,17 @@ public class MacroFormRenderer implements FormStringRenderer {
if (UtilValidate.isNotEmpty(targetBuffer.toString()) && targetBuffer.toString().toLowerCase().startsWith("javascript:")) {
targetType="plain";
}
//FIXME need to change to macro
WidgetWorker.makeHyperlinkString(writer, modelFormField.getHeaderLinkStyle(), targetType, targetBuffer.toString(), null, titleText, modelFormField, this.request, this.response, null, null);
StringWriter sr = new StringWriter();
WidgetWorker.makeHyperlinkString(sr, modelFormField.getHeaderLinkStyle(), targetType, targetBuffer.toString(), null, titleText, modelFormField, this.request, this.response, null, null);
String title = sr.toString().replace("\"", "\'");
sr = new StringWriter();
sr.append("<@renderHyperlinkTitle ");
sr.append(" name=\"");
sr.append(modelFormField.getModelForm().getName());
sr.append("\" title=\"");
sr.append(title);
sr.append("\" />");
executeMacro(sr.toString());
} else if (modelFormField.isSortField()) {
renderSortField (writer, context, modelFormField, titleText);
} else if (modelFormField.isRowSubmit()) {
@@ -2459,7 +2468,7 @@ public class MacroFormRenderer implements FormStringRenderer {
sr.append(modelFormField.getModelForm().getName());
sr.append("\" title=\"");
sr.append(titleText);
sr.append("\" />");
sr.append("\" showSelectAll=\"Y\"/>");
executeMacro(sr.toString());
} else {
writer.append(titleText);