Re: svn commit: r958066 - /ofbiz/trunk/framework/widget/src/org/ofbiz/widget/form/MacroFormRenderer.java

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Re: svn commit: r958066 - /ofbiz/trunk/framework/widget/src/org/ofbiz/widget/form/MacroFormRenderer.java

Adrian Crum-2
Erwan,

I noticed in this commit and in others that you create a copy of the context Map before using it. Why is that necessary? Usually that is done only when you intend to modify the Map's contents and you don't want those changes reflected back to calling code.

-Adrian

--- On Fri, 6/25/10, [hidden email] <[hidden email]> wrote:

From: [hidden email] <[hidden email]>
Subject: svn commit: r958066 - /ofbiz/trunk/framework/widget/src/org/ofbiz/widget/form/MacroFormRenderer.java
To: [hidden email]
Date: Friday, June 25, 2010, 11:32 AM

Author: erwan
Date: Fri Jun 25 18:32:15 2010
New Revision: 958066

URL: http://svn.apache.org/viewvc?rev=958066&view=rev
Log:
Allowing parameters in XML forms when using on-event-update-area

Modified:
    ofbiz/trunk/framework/widget/src/org/ofbiz/widget/form/MacroFormRenderer.java

Modified: ofbiz/trunk/framework/widget/src/org/ofbiz/widget/form/MacroFormRenderer.java
URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/widget/src/org/ofbiz/widget/form/MacroFormRenderer.java?rev=958066&r1=958065&r2=958066&view=diff
==============================================================================
--- ofbiz/trunk/framework/widget/src/org/ofbiz/widget/form/MacroFormRenderer.java (original)
+++ ofbiz/trunk/framework/widget/src/org/ofbiz/widget/form/MacroFormRenderer.java Fri Jun 25 18:32:15 2010
@@ -46,6 +46,7 @@ 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.collections.MapStack;
 import org.ofbiz.base.util.string.FlexibleStringExpander;
 import org.ofbiz.base.util.template.FreeMarkerWorker;
 import org.ofbiz.entity.Delegator;
@@ -2806,7 +2807,9 @@ public class MacroFormRenderer implement
             ajaxUrl += this.rh.makeLink(this.request, this.response, UtilHttp.removeQueryStringFromTarget(targetUrl));
             ajaxUrl += "," + ajaxParams;
         }
-        return ajaxUrl;
+        Locale locale = UtilMisc.ensureLocale(context.get("locale"));
+        MapStack<String> localContext = MapStack.create( (Map<String,Object>)context);
+        return FlexibleStringExpander.expandString(ajaxUrl, localContext, locale);
     }
     /** Extracts parameters from a target URL string, prepares them for an Ajax
      * JavaScript call. This method is currently set to return a parameter string





Reply | Threaded
Open this post in threaded view
|

Re: svn commit: r958066 - /ofbiz/trunk/framework/widget/src/org/ofbiz/widget/form/MacroFormRenderer.java

Erwan de FERRIERES
Le 25/06/2010 21:49, Adrian Crum a écrit :
> Erwan,
>
> I noticed in this commit and in others that you create a copy of the context Map before using it. Why is that necessary? Usually that is done only when you intend to modify the Map's contents and you don't want those changes reflected back to calling code.
>
> -Adrian

Adrian,

you're right, there are some unneeded stuff !
I will quickly correct that.

Thanks,


--
Erwan de FERRIERES
www.nereide.biz