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

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

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

jonesde
Author: jonesde
Date: Fri Jan 15 21:19:21 2010
New Revision: 899815

URL: http://svn.apache.org/viewvc?rev=899815&view=rev
Log:
Fixed bug with form widget and the use-when attribute on fields which caused the header cell to be rendered but no cells would be rendered on certain rows causing the columns to not be aligned; now the cell is rendered, but nothing in it

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=899815&r1=899814&r2=899815&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 Fri Jan 15 21:19:21 2010
@@ -1511,7 +1511,9 @@
                             break;
                         }
 
-                        if (!modelFormField.shouldUse(localContext)) {
+                        // if this is a list or multi form don't skip here because we don't want to skip the table cell, will skip the actual field later
+                        if (!"list".equals(this.getType()) && !"multi".equals(this.getType()) &&
+                                !modelFormField.shouldUse(localContext)) {
                             continue;
                         }
                         innerDisplayHyperlinkFieldsBegin.add(modelFormField);
@@ -1532,7 +1534,9 @@
                             continue;
                         }
 
-                        if (!modelFormField.shouldUse(localContext)) {
+                        // if this is a list or multi form don't skip here because we don't want to skip the table cell, will skip the actual field later
+                        if (!"list".equals(this.getType()) && !"multi".equals(this.getType()) &&
+                                !modelFormField.shouldUse(localContext)) {
                             continue;
                         }
                         innerFormFields.add(modelFormField);
@@ -1552,7 +1556,9 @@
                             continue;
                         }
 
-                        if (!modelFormField.shouldUse(localContext)) {
+                        // if this is a list or multi form don't skip here because we don't want to skip the table cell, will skip the actual field later
+                        if (!"list".equals(this.getType()) && !"multi".equals(this.getType()) &&
+                                !modelFormField.shouldUse(localContext)) {
                             continue;
                         }
                         innerDisplayHyperlinkFieldsEnd.add(modelFormField);
@@ -1613,7 +1619,9 @@
             } else {
                 formStringRenderer.renderFormatItemRowCellOpen(writer, localContext, this, modelFormField, numOfColumnsToSpan);
             }
-            modelFormField.renderFieldString(writer, localContext, formStringRenderer);
+            if ((!"list".equals(this.getType()) && !"multi".equals(this.getType())) || modelFormField.shouldUse(localContext)) {
+                modelFormField.renderFieldString(writer, localContext, formStringRenderer);
+            }
             formStringRenderer.renderFormatItemRowCellClose(writer, localContext, this, modelFormField);
         }
 
@@ -1636,7 +1644,10 @@
                     formStringRenderer.renderFormatItemRowCellOpen(writer, localContext, this, modelFormField, 1);
                 }
                 // render field widget
-                modelFormField.renderFieldString(writer, localContext, formStringRenderer);
+                if ((!"list".equals(this.getType()) && !"multi".equals(this.getType())) || modelFormField.shouldUse(localContext)) {
+                    modelFormField.renderFieldString(writer, localContext, formStringRenderer);
+                }
+                
                 if (separateColumns || modelFormField.getSeparateColumn()) {
                     formStringRenderer.renderFormatItemRowCellClose(writer, localContext, this, modelFormField);
                 }
@@ -1659,7 +1670,9 @@
             } else {
                 formStringRenderer.renderFormatItemRowCellOpen(writer, localContext, this, modelFormField, numOfColumnsToSpan);
             }
-            modelFormField.renderFieldString(writer, localContext, formStringRenderer);
+            if ((!"list".equals(this.getType()) && !"multi".equals(this.getType())) || modelFormField.shouldUse(localContext)) {
+                modelFormField.renderFieldString(writer, localContext, formStringRenderer);
+            }
             formStringRenderer.renderFormatItemRowCellClose(writer, localContext, this, modelFormField);
         }