Quantcast

svn commit: r1331899 - in /ofbiz/branches/release11.04: ./ framework/widget/src/org/ofbiz/widget/screen/MacroScreenRenderer.java

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

svn commit: r1331899 - in /ofbiz/branches/release11.04: ./ framework/widget/src/org/ofbiz/widget/screen/MacroScreenRenderer.java

jleroux-2
Author: jleroux
Date: Sun Apr 29 12:08:05 2012
New Revision: 1331899

URL: http://svn.apache.org/viewvc?rev=1331899&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/release11.04/   (props changed)
    ofbiz/branches/release11.04/framework/widget/src/org/ofbiz/widget/screen/MacroScreenRenderer.java

Propchange: ofbiz/branches/release11.04/
------------------------------------------------------------------------------
  Merged /ofbiz/trunk:r1331898

Modified: ofbiz/branches/release11.04/framework/widget/src/org/ofbiz/widget/screen/MacroScreenRenderer.java
URL: http://svn.apache.org/viewvc/ofbiz/branches/release11.04/framework/widget/src/org/ofbiz/widget/screen/MacroScreenRenderer.java?rev=1331899&r1=1331898&r2=1331899&view=diff
==============================================================================
--- ofbiz/branches/release11.04/framework/widget/src/org/ofbiz/widget/screen/MacroScreenRenderer.java (original)
+++ ofbiz/branches/release11.04/framework/widget/src/org/ofbiz/widget/screen/MacroScreenRenderer.java Sun Apr 29 12:08:05 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;
@@ -53,18 +55,15 @@ 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;
 import freemarker.template.TemplateException;
-import org.xml.sax.SAXException;
-import javax.xml.parsers.ParserConfigurationException;
 
 public class MacroScreenRenderer implements ScreenStringRenderer {
 
@@ -74,6 +73,7 @@ public class MacroScreenRenderer impleme
     private String rendererName;
     private int elementId = 999;
     protected boolean widgetCommentsEnabled = false;
+    private static final String formrenderer = UtilProperties.getPropertyValue("widget", "screen.formrenderer");
 
     public MacroScreenRenderer(String name, String macroLibraryPath) throws TemplateException, IOException {
         macroLibrary = FreeMarkerWorker.getTemplate(macroLibraryPath);
@@ -653,7 +653,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);


Loading...