You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@myfaces.apache.org by bo...@apache.org on 2008/02/13 19:29:52 UTC

svn commit: r627558 - in /myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/renderkit/html: HtmlRendererUtil.java StyleClasses.java

Author: bommel
Date: Wed Feb 13 10:29:49 2008
New Revision: 627558

URL: http://svn.apache.org/viewvc?rev=627558&view=rev
Log:
(TOBAGO-621) Avoid empty class in option element of tc:selectXXX

Modified:
    myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/renderkit/html/HtmlRendererUtil.java
    myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/renderkit/html/StyleClasses.java

Modified: myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/renderkit/html/HtmlRendererUtil.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/renderkit/html/HtmlRendererUtil.java?rev=627558&r1=627557&r2=627558&view=diff
==============================================================================
--- myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/renderkit/html/HtmlRendererUtil.java (original)
+++ myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/renderkit/html/HtmlRendererUtil.java Wed Feb 13 10:29:49 2008
@@ -599,7 +599,9 @@
         if (item instanceof SupportsMarkup) {
           StyleClasses optionStyle = new StyleClasses();
           optionStyle.addMarkupClass((SupportsMarkup) item, getRendererName(facesContext, component), "option");
-          writer.writeClassAttribute(optionStyle);
+          if (!optionStyle.isEmpty()) {
+            writer.writeClassAttribute(optionStyle);
+          }
         }
         if (RenderUtil.contains(values, item.getValue())) {
           writer.writeAttribute(HtmlAttributes.SELECTED, true);

Modified: myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/renderkit/html/StyleClasses.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/renderkit/html/StyleClasses.java?rev=627558&r1=627557&r2=627558&view=diff
==============================================================================
--- myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/renderkit/html/StyleClasses.java (original)
+++ myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/renderkit/html/StyleClasses.java Wed Feb 13 10:29:49 2008
@@ -95,6 +95,10 @@
     classes.remove(nameOfClass(renderer, sub));
   }
 
+  public boolean isEmpty() {
+    return classes.isEmpty();
+  }
+
   private String nameOfClass(String renderer, String sub) {
     StringBuilder builder = new StringBuilder();
     builder.append(PREFIX);