Author: jacopoc
Date: Wed Apr 2 04:29:36 2008
New Revision: 643853
URL:
http://svn.apache.org/viewvc?rev=643853&view=revLog:
Added support for localized entity content to display-entity form fields.
Modified:
ofbiz/trunk/framework/widget/src/org/ofbiz/widget/form/ModelFormField.java
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=643853&r1=643852&r2=643853&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 Apr 2 04:29:36 2008
@@ -1898,8 +1898,17 @@
String retVal = null;
if (value != null) {
- //Debug.logInfo("In DisplayEntityField.getDescription value=" + value + "; entityName=" + this.entityName, module);
- retVal = this.description.expandString(value, locale);
+ // expanding ${} stuff, passing locale explicitly to expand value string because it won't be found in the Entity
+ MapStack localContext = null;
+ if (context instanceof MapStack) {
+ localContext = ((MapStack) context).standAloneStack();
+ } else {
+ localContext = MapStack.create(context);
+ }
+ localContext.push(value);
+
+ // expand with the new localContext, which is locale aware
+ retVal = this.description.expandString(localContext, locale);
}
// try to get the entry for the field if description doesn't expand to anything
if (retVal == null || retVal.length() == 0) {