Author: jacopoc
Date: Sat Jul 4 01:35:53 2009
New Revision: 791046
URL:
http://svn.apache.org/viewvc?rev=791046&view=revLog:
Fix for a bug that was causing layout issues in widget forms definitions containing use-when directives when rendered thru FO.
Modified:
ofbiz/trunk/framework/widget/src/org/ofbiz/widget/form/MacroFormRenderer.java
ofbiz/trunk/framework/widget/templates/foFormMacroLibrary.ftl
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=791046&r1=791045&r2=791046&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 Sat Jul 4 01:35:53 2009
@@ -37,6 +37,7 @@
import javax.servlet.http.HttpServletResponse;
import javolution.util.FastList;
+import javolution.util.FastSet;
import org.ofbiz.base.util.Debug;
import org.ofbiz.base.util.StringUtil;
@@ -1228,6 +1229,7 @@
}
List<ModelFormField> childFieldList = modelForm.getFieldList();
List<String> columnStyleList = FastList.newInstance();
+ List<String> fieldNameList = FastList.newInstance();
for (ModelFormField childField : childFieldList) {
int childFieldType = childField.getFieldInfo().getFieldType();
if (childFieldType == ModelFormField.FieldInfo.HIDDEN || childFieldType == ModelFormField.FieldInfo.IGNORED) {
@@ -1237,7 +1239,14 @@
if (UtilValidate.isEmpty(areaStyle)) {
areaStyle = "";
}
- columnStyleList.add(areaStyle);
+ if (fieldNameList.contains(childField.getName())) {
+ if (UtilValidate.isNotEmpty(areaStyle)) {
+ columnStyleList.set(fieldNameList.indexOf(childField.getName()), areaStyle);
+ }
+ } else {
+ columnStyleList.add(areaStyle);
+ fieldNameList.add(childField.getName());
+ }
}
columnStyleList = StringUtil.quoteStrList(columnStyleList);
String columnStyleListString = StringUtil.join(columnStyleList, ", ");
Modified: ofbiz/trunk/framework/widget/templates/foFormMacroLibrary.ftl
URL:
http://svn.apache.org/viewvc/ofbiz/trunk/framework/widget/templates/foFormMacroLibrary.ftl?rev=791046&r1=791045&r2=791046&view=diff==============================================================================
--- ofbiz/trunk/framework/widget/templates/foFormMacroLibrary.ftl (original)
+++ ofbiz/trunk/framework/widget/templates/foFormMacroLibrary.ftl Sat Jul 4 01:35:53 2009
@@ -25,6 +25,7 @@
"tableheadsmall":"column-width=\"0.5in\"",
"tableheadmedium":"column-width=\"1.5in\"",
"tableheadwide":"column-width=\"3in\"",
+ "tableheadhuge":"column-width=\"5in\"",
"head1":"font-size=\"12\" font-weight=\"bold\"",
"head2":"font-weight=\"bold\"",
"head3":"font-weight=\"bold\" font-style=\"italic\"",