myfaces-commits mailing list archives

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

URL: http://svn.apache.org/viewvc?rev=1792974&view=rev
Log:
MYFACES-4113 Implement h:panelGrid rowClass

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

Modified: myfaces/core/branches/2.3.x/api/src/main/java/javax/faces/component/html/_HtmlPanelGrid.java
URL: http://svn.apache.org/viewvc/myfaces/core/branches/2.3.x/api/src/main/java/javax/faces/component/html/_HtmlPanelGrid.java?rev=1792974&r1=1792973&r2=1792974&view=diff
==============================================================================
--- myfaces/core/branches/2.3.x/api/src/main/java/javax/faces/component/html/_HtmlPanelGrid.java
(original)
+++ myfaces/core/branches/2.3.x/api/src/main/java/javax/faces/component/html/_HtmlPanelGrid.java
Fri Apr 28 03:12:25 2017
@@ -178,4 +178,11 @@ _StyleProperties, _UniversalProperties,
   @JSFProperty
   public abstract String getCaptionStyle();
 
+  /**
+   * @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/HtmlGridRendererBase.java
URL: http://svn.apache.org/viewvc/myfaces/core/branches/2.3.x/shared/src/main/java/org/apache/myfaces/shared/renderkit/html/HtmlGridRendererBase.java?rev=1792974&r1=1792973&r2=1792974&view=diff
==============================================================================
--- myfaces/core/branches/2.3.x/shared/src/main/java/org/apache/myfaces/shared/renderkit/html/HtmlGridRendererBase.java
(original)
+++ myfaces/core/branches/2.3.x/shared/src/main/java/org/apache/myfaces/shared/renderkit/html/HtmlGridRendererBase.java
Fri Apr 28 03:12:25 2017
@@ -335,9 +335,25 @@ public class HtmlGridRendererBase
                         
                         //start of new/next row
                         writer.startElement(HTML.TR_ELEM, null); // component);
-                        if (rowClassIndex < rowClassesCount)
+                        String rowClass = null;
+                        if (component instanceof HtmlPanelGrid)
                         {
-                            writer.writeAttribute(HTML.CLASS_ATTR, rowClassesArray[rowClassIndex],
null);
+                            rowClass = ((HtmlPanelGrid) component).getRowClass();
+                        }
+                        if (rowClassIndex < rowClassesCount) 
+                        {
+                            if (rowClass == null) 
+                            {
+                                rowClass = rowClassesArray[rowClassIndex];
+                            }
+                            else
+                            {
+                                rowClass = rowClass+" "+rowClassesArray[rowClassIndex];
+                            }
+                        }
+                        if (rowClass != null)
+                        {
+                            writer.writeAttribute(HTML.CLASS_ATTR, rowClass, null);
                         }
                         rowStarted = true;
                         rowClassIndex++;



Mime
View raw message