myfaces-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From lu4...@apache.org
Subject svn commit: r1792970 - in /myfaces/core/branches/2.3.x: api/src/main/java/javax/faces/component/html/_HtmlColumn.java shared/src/main/java/org/apache/myfaces/shared/renderkit/html/HtmlTableRendererBase.java
Date Fri, 28 Apr 2017 02:29:12 GMT
Author: lu4242
Date: Fri Apr 28 02:29:12 2017
New Revision: 1792970

URL: http://svn.apache.org/viewvc?rev=1792970&view=rev
Log:
MYFACES-4111 Implement h:column styleClass property

Modified:
    myfaces/core/branches/2.3.x/api/src/main/java/javax/faces/component/html/_HtmlColumn.java
    myfaces/core/branches/2.3.x/shared/src/main/java/org/apache/myfaces/shared/renderkit/html/HtmlTableRendererBase.java

Modified: myfaces/core/branches/2.3.x/api/src/main/java/javax/faces/component/html/_HtmlColumn.java
URL: http://svn.apache.org/viewvc/myfaces/core/branches/2.3.x/api/src/main/java/javax/faces/component/html/_HtmlColumn.java?rev=1792970&r1=1792969&r2=1792970&view=diff
==============================================================================
--- myfaces/core/branches/2.3.x/api/src/main/java/javax/faces/component/html/_HtmlColumn.java
(original)
+++ myfaces/core/branches/2.3.x/api/src/main/java/javax/faces/component/html/_HtmlColumn.java
Fri Apr 28 02:29:12 2017
@@ -80,4 +80,11 @@ abstract class _HtmlColumn extends UICol
   {
       return super.isRendered();
   }
+  
+  /**
+   * @since 2.3
+   * @return 
+   */
+  @JSFProperty
+  public abstract String getStyleClass();
 }

Modified: myfaces/core/branches/2.3.x/shared/src/main/java/org/apache/myfaces/shared/renderkit/html/HtmlTableRendererBase.java
URL: http://svn.apache.org/viewvc/myfaces/core/branches/2.3.x/shared/src/main/java/org/apache/myfaces/shared/renderkit/html/HtmlTableRendererBase.java?rev=1792970&r1=1792969&r2=1792970&view=diff
==============================================================================
--- myfaces/core/branches/2.3.x/shared/src/main/java/org/apache/myfaces/shared/renderkit/html/HtmlTableRendererBase.java
(original)
+++ myfaces/core/branches/2.3.x/shared/src/main/java/org/apache/myfaces/shared/renderkit/html/HtmlTableRendererBase.java
Fri Apr 28 02:29:12 2017
@@ -672,9 +672,25 @@ public class HtmlTableRendererBase exten
         {
             writer.startElement(HTML.TD_ELEM, null); // uiData);
         }
-        if (styles.hasColumnStyle())
+        String styleClass = null;
+        if (component instanceof HtmlColumn) 
         {
-            writer.writeAttribute(HTML.CLASS_ATTR, styles.getColumnStyle(columnStyleIndex),
null);
+            styleClass = ((HtmlColumn) component).getStyleClass();
+        }
+        if (styles.hasColumnStyle()) 
+        {
+            if (styleClass == null) 
+            {
+                styleClass = styles.getColumnStyle(columnStyleIndex);
+            }
+            else
+            {
+                styleClass = styleClass+" "+styles.getColumnStyle(columnStyleIndex);
+            }
+        }
+        if (styleClass != null)
+        {
+            writer.writeAttribute(HTML.CLASS_ATTR, styleClass, null);
         }
         //RendererUtils.renderChild(facesContext, component);
         component.encodeAll(facesContext);



Mime
View raw message