svn commit: r564961 - /ofbiz/trunk/framework/widget/src/org/ofbiz/widget/html/HtmlTreeRenderer.java

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

svn commit: r564961 - /ofbiz/trunk/framework/widget/src/org/ofbiz/widget/html/HtmlTreeRenderer.java

jleroux@apache.org
Author: jleroux
Date: Sat Aug 11 13:00:25 2007
New Revision: 564961

URL: http://svn.apache.org/viewvc?view=rev&rev=564961
Log:
A patch from Adrian Crum "HtmlTreeRenderer.java Outputs Improperly Nested <ul> Elements" (https://issues.apache.org/jira/browse/OFBIZ-1195)


Modified:
    ofbiz/trunk/framework/widget/src/org/ofbiz/widget/html/HtmlTreeRenderer.java

Modified: ofbiz/trunk/framework/widget/src/org/ofbiz/widget/html/HtmlTreeRenderer.java
URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/widget/src/org/ofbiz/widget/html/HtmlTreeRenderer.java?view=diff&rev=564961&r1=564960&r2=564961
==============================================================================
--- ofbiz/trunk/framework/widget/src/org/ofbiz/widget/html/HtmlTreeRenderer.java (original)
+++ ofbiz/trunk/framework/widget/src/org/ofbiz/widget/html/HtmlTreeRenderer.java Sat Aug 11 13:00:25 2007
@@ -68,13 +68,10 @@
         context.put("depth", Integer.toString(depth));
         if (node.isRootNode()) {
             appendWhitespace(writer);
-            writer.write("<!-- begin tree widget -->");
-            appendWhitespace(writer);
             writer.write("<ul class=\"basic-tree\">");
-        } else {
-            appendWhitespace(writer);
-            writer.write(" <li>");
         }
+        appendWhitespace(writer);
+        writer.write("<li>");
 
         String pkName = node.getPkName();
         String entityId = null;
@@ -162,30 +159,25 @@
     }
 
     public void renderNodeEnd(Writer writer, Map context, ModelTree.ModelNode node) throws IOException {
-        if (node.isRootNode()) {
+        Boolean processChildren = (Boolean) context.get("processChildren");
+        if (processChildren.booleanValue()) {
             appendWhitespace(writer);
             writer.write("</ul>");
+        }
+        appendWhitespace(writer);
+        writer.write("</li>");
+        if (node.isRootNode()){
             appendWhitespace(writer);
-            writer.write("<!-- end tree widget -->");
+            writer.write("</ul>");
             appendWhitespace(writer);
         }
-        else {
-            Boolean processChildren = (Boolean) context.get("processChildren");
-            if (processChildren.booleanValue()) {
-                appendWhitespace(writer);
-                writer.write("</ul>");
-            }
-            writer.write("</li>");
-        }
     }
 
     public void renderLastElement(Writer writer, Map context, ModelTree.ModelNode node) throws IOException {
-        if (!node.isRootNode()) {
-            Boolean processChildren = (Boolean) context.get("processChildren");
-            if (processChildren.booleanValue()) {
-                appendWhitespace(writer);
-                writer.write("<ul class=\"basic-tree\">");
-            }
+        Boolean processChildren = (Boolean) context.get("processChildren");
+        if (processChildren.booleanValue()) {
+            appendWhitespace(writer);
+            writer.write("<ul class=\"basic-tree\">");
         }
     }