Author: jleroux
Date: Sun Apr 29 12:12:20 2012 New Revision: 1331900 URL: http://svn.apache.org/viewvc?rev=1331900&view=rev Log: "Applied fix from trunk for revision: 1331898" ------------------------------------------------------------------------ r1331898 | jleroux | 2012-04-29 14:07:08 +0200 (dim., 29 avr. 2012) | 9 lines Fixes "View Calendar Broken in Party Manager > Relationships" https://issues.apache.org/jira/browse/OFBIZ-4739 This was due to MacroScreenRenderer.renderScreenletSubWidget() calling HtmlFormRenderer instead of MacroFormRenderer. So there was still a call to the old, now inexistent, call_cal js function. So this not only fixes this case but also all other similar cases, when a navigation-form-name screenlet attribute was used and a date field used in the related form. I have also checked there are no other uses of HtmlFormRenderer in MacroScreenRenderer. So I think w are safe from other side effects... ------------------------------------------------------------------------ Modified: ofbiz/branches/release10.04/ (props changed) ofbiz/branches/release10.04/framework/widget/src/org/ofbiz/widget/screen/MacroScreenRenderer.java Propchange: ofbiz/branches/release10.04/ ------------------------------------------------------------------------------ Merged /ofbiz/trunk:r1331898 Modified: ofbiz/branches/release10.04/framework/widget/src/org/ofbiz/widget/screen/MacroScreenRenderer.java URL: http://svn.apache.org/viewvc/ofbiz/branches/release10.04/framework/widget/src/org/ofbiz/widget/screen/MacroScreenRenderer.java?rev=1331900&r1=1331899&r2=1331900&view=diff ============================================================================== --- ofbiz/branches/release10.04/framework/widget/src/org/ofbiz/widget/screen/MacroScreenRenderer.java (original) +++ ofbiz/branches/release10.04/framework/widget/src/org/ofbiz/widget/screen/MacroScreenRenderer.java Sun Apr 29 12:12:20 2012 @@ -32,6 +32,7 @@ import java.util.WeakHashMap; import javax.servlet.ServletContext; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; +import javax.xml.parsers.ParserConfigurationException; import javolution.util.FastMap; @@ -41,6 +42,7 @@ import org.ofbiz.base.util.UtilFormatOut import org.ofbiz.base.util.UtilGenerics; import org.ofbiz.base.util.UtilHttp; import org.ofbiz.base.util.UtilMisc; +import org.ofbiz.base.util.UtilProperties; import org.ofbiz.base.util.UtilValidate; import org.ofbiz.base.util.template.FreeMarkerWorker; import org.ofbiz.entity.Delegator; @@ -51,12 +53,11 @@ import org.ofbiz.widget.WidgetContentWor import org.ofbiz.widget.WidgetDataResourceWorker; import org.ofbiz.widget.WidgetWorker; import org.ofbiz.widget.form.FormStringRenderer; +import org.ofbiz.widget.form.MacroFormRenderer; import org.ofbiz.widget.form.ModelForm; -import org.ofbiz.widget.html.HtmlFormRenderer; import org.ofbiz.widget.html.HtmlScreenRenderer.ScreenletMenuRenderer; import org.ofbiz.widget.menu.MenuStringRenderer; -import org.ofbiz.widget.screen.ModelScreenWidget; -import org.ofbiz.widget.screen.ScreenStringRenderer; +import org.xml.sax.SAXException; import freemarker.core.Environment; import freemarker.template.Template; @@ -69,6 +70,7 @@ public class MacroScreenRenderer impleme private WeakHashMap<Appendable, Environment> environments = new WeakHashMap<Appendable, Environment>(); private String rendererName; private int elementId = 999; + private static final String formrenderer = UtilProperties.getPropertyValue("widget", "screen.formrenderer"); public MacroScreenRenderer(String name, String macroLibraryPath) throws TemplateException, IOException { macroLibrary = FreeMarkerWorker.getTemplate(macroLibraryPath); @@ -700,7 +702,12 @@ public class MacroScreenRenderer impleme Map<String, Object> globalCtx = UtilGenerics.checkMap(context.get("globalContext")); globalCtx.put("NO_PAGINATOR", true); FormStringRenderer savedRenderer = (FormStringRenderer) context.get("formStringRenderer"); - HtmlFormRenderer renderer = new HtmlFormRenderer(request, response); + MacroFormRenderer renderer = null; + try { + renderer = new MacroFormRenderer(formrenderer, request, response); + } catch (TemplateException e) { + Debug.logError("Not rendering content, error on MacroFormRenderer creation.", module); + } renderer.setRenderPagination(false); context.put("formStringRenderer", renderer); subWidget.renderWidgetString(writer, context, this); |
Free forum by Nabble | Edit this page |