svn commit: r486834 - /incubator/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: r486834 - /incubator/ofbiz/trunk/framework/widget/src/org/ofbiz/widget/form/ModelForm.java

jleroux@apache.org
Author: jleroux
Date: Wed Dec 13 12:44:40 2006
New Revision: 486834

URL: http://svn.apache.org/viewvc?view=rev&rev=486834
Log:
A patch from Valentina Sirkova "Unnecessary extra cells on list based tables" (https://issues.apache.org/jira/browse/OFBIZ-542).
   

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

Modified: incubator/ofbiz/trunk/framework/widget/src/org/ofbiz/widget/form/ModelForm.java
URL: http://svn.apache.org/viewvc/incubator/ofbiz/trunk/framework/widget/src/org/ofbiz/widget/form/ModelForm.java?view=diff&rev=486834&r1=486833&r2=486834
==============================================================================
--- incubator/ofbiz/trunk/framework/widget/src/org/ofbiz/widget/form/ModelForm.java (original)
+++ incubator/ofbiz/trunk/framework/widget/src/org/ofbiz/widget/form/ModelForm.java Wed Dec 13 12:44:40 2006
@@ -100,7 +100,8 @@
     protected boolean skipEnd = false;
     protected boolean hideHeader = false;
     protected boolean overridenListSize = false;
-
+    protected boolean listEnd = false;
+    
     protected List altTargets = new LinkedList();
     protected List autoFieldsServices = new LinkedList();
     protected List autoFieldsEntities = new LinkedList();
@@ -997,7 +998,11 @@
             //Modification Nicolas
             previousModelFormField = modelFormField;
         }
-
+        
+        if (!displayHyperlinkFieldIter.hasNext()) {
+            listEnd = true;
+        }
+        
         List headerFormFields = new LinkedList();
         Iterator formFieldIter = this.fieldList.iterator();
         //boolean isFirstFormHeader = true;
@@ -1023,7 +1028,9 @@
         }
 
         // render the "form" cell
-        formStringRenderer.renderFormatHeaderRowFormCellOpen(buffer, context, this);
+        if (!listEnd) {
+            formStringRenderer.renderFormatHeaderRowFormCellOpen(buffer, context, this);
+        }
 
         Iterator headerFormFieldIter = headerFormFields.iterator();
         while (headerFormFieldIter.hasNext()) {
@@ -1046,7 +1053,9 @@
             }
         }
 
-        formStringRenderer.renderFormatHeaderRowFormCellClose(buffer, context, this);
+        if (!listEnd) {
+            formStringRenderer.renderFormatHeaderRowFormCellClose(buffer, context, this);
+        }
 
         // render the rest of the display/hyperlink fields
         while (displayHyperlinkFieldIter.hasNext()) {
@@ -1205,7 +1214,9 @@
                 }
 
                 // render the "form" cell
-                formStringRenderer.renderFormatItemRowFormCellOpen(buffer, localContext, this);
+                if (!listEnd) {
+                    formStringRenderer.renderFormatItemRowFormCellOpen(buffer, localContext, this);
+                }
 
                 if (formPerItem) {
                     formStringRenderer.renderFormOpen(buffer, localContext, this);
@@ -1246,7 +1257,9 @@
                     formStringRenderer.renderFormClose(buffer, localContext, this);
                 }
 
-                formStringRenderer.renderFormatItemRowFormCellClose(buffer, localContext, this);
+                if (!listEnd) {
+                    formStringRenderer.renderFormatItemRowFormCellClose(buffer, localContext, this);
+                }
 
                 // render the rest of the display/hyperlink fields
                 while (innerDisplayHyperlinkFieldIter.hasNext()) {