You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ofbiz.apache.org by ad...@apache.org on 2013/06/12 10:29:41 UTC

svn commit: r1492112 - in /ofbiz/trunk/framework/widget/src/org/ofbiz/widget/form: ModelForm.java ModelFormField.java

Author: adrianc
Date: Wed Jun 12 08:29:41 2013
New Revision: 1492112

URL: http://svn.apache.org/r1492112
Log:
Fixed a bug introduced in revisions 1480407 and 1481287 - form widget fields were not translated.

https://issues.apache.org/jira/browse/OFBIZ-5219

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

Modified: ofbiz/trunk/framework/widget/src/org/ofbiz/widget/form/ModelForm.java
URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/widget/src/org/ofbiz/widget/form/ModelForm.java?rev=1492112&r1=1492111&r2=1492112&view=diff
==============================================================================
--- ofbiz/trunk/framework/widget/src/org/ofbiz/widget/form/ModelForm.java (original)
+++ ofbiz/trunk/framework/widget/src/org/ofbiz/widget/form/ModelForm.java Wed Jun 12 08:29:41 2013
@@ -21,7 +21,6 @@ package org.ofbiz.widget.form;
 import java.io.IOException;
 import java.util.ArrayList;
 import java.util.Collection;
-import java.util.HashMap;
 import java.util.Iterator;
 import java.util.List;
 import java.util.Locale;
@@ -1550,7 +1549,8 @@ public class ModelForm extends ModelWidg
                     if (itemMap instanceof GenericEntity) {
                         // Rendering code might try to modify the GenericEntity instance,
                         // so we make a copy of it.
-                        localContext.push(new HashMap<String, Object>(itemMap));
+                        Map<String, Object> genericEntityClone = UtilGenerics.cast(((GenericEntity)itemMap).clone());
+                        localContext.push(genericEntityClone);
                     } else {
                         localContext.push(itemMap);
                     }

Modified: ofbiz/trunk/framework/widget/src/org/ofbiz/widget/form/ModelFormField.java
URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/widget/src/org/ofbiz/widget/form/ModelFormField.java?rev=1492112&r1=1492111&r2=1492112&view=diff
==============================================================================
--- ofbiz/trunk/framework/widget/src/org/ofbiz/widget/form/ModelFormField.java (original)
+++ ofbiz/trunk/framework/widget/src/org/ofbiz/widget/form/ModelFormField.java Wed Jun 12 08:29:41 2013
@@ -1624,7 +1624,8 @@ public class ModelFormField {
                     MapStack<String> localContext = MapStack.create(context);
                     // Rendering code might try to modify the GenericEntity instance,
                     // so we make a copy of it.
-                    localContext.push(new HashMap<String, Object>(value));
+                    Map<String, Object> genericEntityClone = UtilGenerics.cast(value.clone());
+                    localContext.push(genericEntityClone);
 
                     // expand with the new localContext, which is locale aware
                     String optionDesc = this.description.expandString(localContext, locale);
@@ -2183,7 +2184,8 @@ public class ModelFormField {
                 MapStack<String> localContext = MapStack.create(context);
                 // Rendering code might try to modify the GenericEntity instance,
                 // so we make a copy of it.
-                localContext.push(new HashMap<String, Object>(value));
+                Map<String, Object> genericEntityClone = UtilGenerics.cast(value.clone());
+                localContext.push(genericEntityClone);
 
                 // expand with the new localContext, which is locale aware
                 retVal = this.description.expandString(localContext, locale);