You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@myfaces.apache.org by ha...@apache.org on 2008/06/27 20:58:22 UTC

svn commit: r672353 - /myfaces/tomahawk/trunk/core/src/main/java/org/apache/myfaces/custom/tree2/HtmlTreeRenderer.java

Author: hazems
Date: Fri Jun 27 11:58:21 2008
New Revision: 672353

URL: http://svn.apache.org/viewvc?rev=672353&view=rev
Log:
Fix for http://issues.apache.org/jira/browse/TOMAHAWK-1143.
"Tree2 renders nonconformant XHTML code
- background attribute not allowed for <td>
- <img> without alt attribute".
Solved after spending many hours.
It was really a tricky defect!!!

Modified:
    myfaces/tomahawk/trunk/core/src/main/java/org/apache/myfaces/custom/tree2/HtmlTreeRenderer.java

Modified: myfaces/tomahawk/trunk/core/src/main/java/org/apache/myfaces/custom/tree2/HtmlTreeRenderer.java
URL: http://svn.apache.org/viewvc/myfaces/tomahawk/trunk/core/src/main/java/org/apache/myfaces/custom/tree2/HtmlTreeRenderer.java?rev=672353&r1=672352&r2=672353&view=diff
==============================================================================
--- myfaces/tomahawk/trunk/core/src/main/java/org/apache/myfaces/custom/tree2/HtmlTreeRenderer.java (original)
+++ myfaces/tomahawk/trunk/core/src/main/java/org/apache/myfaces/custom/tree2/HtmlTreeRenderer.java Fri Jun 27 11:58:21 2008
@@ -498,7 +498,8 @@
 
         if ((bitMask & LINES)!=0 && (bitMask & LAST)==0)
         {
-            out.writeURIAttribute("background", getImageSrc(context, tree, "line-trunk.gif", true), null);
+            //out.writeURIAttribute("background", getImageSrc(context, tree, "line-trunk.gif", true), null);
+            out.writeURIAttribute(HTML.STYLE_ATTR, "background-image:" + getImageSrc(context, tree, "line-trunk.gif", true) + ";", null); 
         }
 
 //      add the appropriate image for the nav control
@@ -506,10 +507,12 @@
         String imageId = IMAGE_PREFIX+(counter++);
         image.setId(imageId);
         image.setUrl(navSrcUrl);
+        
         Map imageAttrs = image.getAttributes();
         imageAttrs.put(HTML.WIDTH_ATTR, "19");
         imageAttrs.put(HTML.HEIGHT_ATTR, "18");
         imageAttrs.put(HTML.BORDER_ATTR, "0");
+        imageAttrs.put(HTML.ALT_ATTR, ""); // "alt" is a mandatory xhtml attribute
 
         if (clientSideToggle)
         {