myfaces-commits mailing list archives

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

URL: http://svn.apache.org/viewvc?rev=1792973&view=rev
Log:
MYFACES-4112 Implement h:dataTable rowClass

Modified:
    myfaces/core/branches/2.3.x/api/src/main/java/javax/faces/component/html/_HtmlDataTable.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/_HtmlDataTable.java
URL: http://svn.apache.org/viewvc/myfaces/core/branches/2.3.x/api/src/main/java/javax/faces/component/html/_HtmlDataTable.java?rev=1792973&r1=1792972&r2=1792973&view=diff
==============================================================================
--- myfaces/core/branches/2.3.x/api/src/main/java/javax/faces/component/html/_HtmlDataTable.java
(original)
+++ myfaces/core/branches/2.3.x/api/src/main/java/javax/faces/component/html/_HtmlDataTable.java
Fri Apr 28 02:54:40 2017
@@ -184,4 +184,10 @@ abstract class _HtmlDataTable extends UI
   @JSFExclude
   public abstract UIComponent getCaption();
   
+  /**
+   * @since 2.3
+   * @return 
+   */
+  @JSFProperty
+  public abstract String getRowClass();
 }

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=1792973&r1=1792972&r2=1792973&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:54:40 2017
@@ -732,10 +732,25 @@ public class HtmlTableRendererBase exten
     protected void renderRowStyle(FacesContext facesContext, ResponseWriter writer, 
             UIData uiData, Styles styles, int rowStyleIndex) throws IOException
     {
-        if(styles.hasRowStyle())
+        String rowClass = null;
+        if (uiData instanceof HtmlDataTable)
         {
-            String rowStyle = styles.getRowStyle(rowStyleIndex);
-            writer.writeAttribute(HTML.CLASS_ATTR, rowStyle, null);
+            rowClass = ((HtmlDataTable) uiData).getRowClass();
+        }
+        if (styles.hasRowStyle()) 
+        {
+            if (rowClass == null) 
+            {
+                rowClass = styles.getRowStyle(rowStyleIndex);
+            }
+            else
+            {
+                rowClass = rowClass+" "+styles.getRowStyle(rowStyleIndex);
+            }
+        }
+        if (rowClass != null)
+        {
+            writer.writeAttribute(HTML.CLASS_ATTR, rowClass, null);
         }
     }
 



Mime
View raw message