Author: bibryam
Date: Wed Nov 11 21:38:16 2009
New Revision: 835081
URL:
http://svn.apache.org/viewvc?rev=835081&view=revLog:
Fixed rendering of image elements inside link elements.
Modified:
ofbiz/trunk/framework/widget/src/org/ofbiz/widget/screen/MacroScreenRenderer.java
ofbiz/trunk/framework/widget/templates/htmlScreenMacroLibrary.ftl
Modified: ofbiz/trunk/framework/widget/src/org/ofbiz/widget/screen/MacroScreenRenderer.java
URL:
http://svn.apache.org/viewvc/ofbiz/trunk/framework/widget/src/org/ofbiz/widget/screen/MacroScreenRenderer.java?rev=835081&r1=835080&r2=835081&view=diff==============================================================================
--- ofbiz/trunk/framework/widget/src/org/ofbiz/widget/screen/MacroScreenRenderer.java (original)
+++ ofbiz/trunk/framework/widget/src/org/ofbiz/widget/screen/MacroScreenRenderer.java Wed Nov 11 21:38:16 2009
@@ -245,10 +245,10 @@
}
String imgStr = "";
ModelScreenWidget.Image img = link.getImage();
- if (img == null) {
- StringBuilder sb = new StringBuilder();
- renderImage(sb,context,img);
- imgStr = sb.toString();
+ if (img != null) {
+ StringWriter sw = new StringWriter();
+ renderImage(sw, context, img);
+ imgStr = sw.toString();
}
StringWriter sr = new StringWriter();
sr.append("<@renderLink ");
@@ -275,7 +275,7 @@
sr.append("\" text=\"");
sr.append(text);
sr.append("\" imgStr=\"");
- sr.append(imgStr);
+ sr.append(imgStr.replaceAll("\"", "\\\\\""));
sr.append("\" />");
executeMacro(sr.toString());
}
@@ -335,7 +335,7 @@
sr.append("\" urlString=\"");
sr.append(urlString);
sr.append("\" />");
- executeMacro(sr.toString());
+ executeMacro(writer, sr.toString());
}
public void renderContentBegin(Appendable writer, Map<String, Object> context, ModelScreenWidget.Content content) throws IOException {
Modified: ofbiz/trunk/framework/widget/templates/htmlScreenMacroLibrary.ftl
URL:
http://svn.apache.org/viewvc/ofbiz/trunk/framework/widget/templates/htmlScreenMacroLibrary.ftl?rev=835081&r1=835080&r2=835081&view=diff==============================================================================
--- ofbiz/trunk/framework/widget/templates/htmlScreenMacroLibrary.ftl (original)
+++ ofbiz/trunk/framework/widget/templates/htmlScreenMacroLibrary.ftl Wed Nov 11 21:38:16 2009
@@ -120,7 +120,7 @@
</form><#rt/>
</#if>
<a <#if id?has_content>id="${id}"</#if> <#if style?has_content>class="${style}"</#if> <#if name?has_content>name="${name}"</#if> <#if targetWindow?has_content>target="${targetWindow}"</#if> href="<#if "hidden-form"==linkType>javascript:document.${uniqueItemName}.submit()<#else>${linkUrl}</#if>"><#rt/>
-<#if image?has_content>${imgStr}<#else><#if text?has_content>${text}</#if></#if></a>
+<#if imgStr?has_content>${imgStr}<#else><#if text?has_content>${text}</#if></#if></a>
</#macro>
<#macro renderImage src id style wid hgt border alt urlString>
<#if src?has_content>