You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ofbiz.apache.org by er...@apache.org on 2010/06/14 15:12:06 UTC

svn commit: r954437 - /ofbiz/trunk/framework/widget/src/org/ofbiz/widget/form/ModelForm.java

Author: erwan
Date: Mon Jun 14 13:12:06 2010
New Revision: 954437

URL: http://svn.apache.org/viewvc?rev=954437&view=rev
Log:
Allows to parameterize a form id

Modified:
    ofbiz/trunk/framework/widget/src/org/ofbiz/widget/form/ModelForm.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=954437&r1=954436&r2=954437&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 Mon Jun 14 13:12:06 2010
@@ -1986,12 +1986,18 @@ public class ModelForm extends ModelWidg
     }
 
     public String getCurrentContainerId(Map<String, Object> context) {
+        Locale locale = UtilMisc.ensureLocale(context.get("locale"));
+        MapStack<String> localContext = MapStack.create(context);
+
+        FlexibleStringExpander containerIdExpander = FlexibleStringExpander.getInstance(this.getContainerId());
+        String retVal = containerIdExpander.expandString(localContext, locale);
+
         Integer itemIndex = (Integer) context.get("itemIndex");
         if (itemIndex != null && "list".equals(this.getType())) {
-            return this.getContainerId() + this.getItemIndexSeparator() + itemIndex.intValue();
+            return retVal + this.getItemIndexSeparator() + itemIndex.intValue();
         }
 
-        return this.getContainerId();
+        return retVal;
     }
 
     public String getContainerStyle() {



Re: svn commit: r954437 - /ofbiz/trunk/framework/widget/src/org/ofbiz/widget/form/ModelForm.java

Posted by Adrian Crum <ad...@hlmksw.com>.
On 6/14/2010 6:12 AM, erwan@apache.org wrote:
> Author: erwan
> Date: Mon Jun 14 13:12:06 2010
> New Revision: 954437
>
> URL: http://svn.apache.org/viewvc?rev=954437&view=rev
> Log:
> Allows to parameterize a form id
>
> Modified:
>      ofbiz/trunk/framework/widget/src/org/ofbiz/widget/form/ModelForm.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=954437&r1=954436&r2=954437&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 Mon Jun 14 13:12:06 2010
> @@ -1986,12 +1986,18 @@ public class ModelForm extends ModelWidg
>       }
>
>       public String getCurrentContainerId(Map<String, Object>  context) {
> +        Locale locale = UtilMisc.ensureLocale(context.get("locale"));
> +        MapStack<String>  localContext = MapStack.create(context);
> +
> +        FlexibleStringExpander containerIdExpander = FlexibleStringExpander.getInstance(this.getContainerId());
> +        String retVal = containerIdExpander.expandString(localContext, locale);


String retVal = 
FlexibleStringExpander.expandString(this.getContainerId(), localContext, 
locale);


> +
>           Integer itemIndex = (Integer) context.get("itemIndex");
>           if (itemIndex != null&&  "list".equals(this.getType())) {
> -            return this.getContainerId() + this.getItemIndexSeparator() + itemIndex.intValue();
> +            return retVal + this.getItemIndexSeparator() + itemIndex.intValue();
>           }
>
> -        return this.getContainerId();
> +        return retVal;
>       }
>
>       public String getContainerStyle() {
>
>
>