You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@myfaces.apache.org by sc...@apache.org on 2006/06/13 16:13:48 UTC

svn commit: r413904 - /myfaces/shared/trunk/core/src/main/java/org/apache/myfaces/shared/renderkit/html/HtmlTableRendererBase.java

Author: schof
Date: Tue Jun 13 07:13:48 2006
New Revision: 413904

URL: http://svn.apache.org/viewvc?rev=413904&view=rev
Log:
Fixes TOMAHAWK-485 (Patch by Dan Allen)

Modified:
    myfaces/shared/trunk/core/src/main/java/org/apache/myfaces/shared/renderkit/html/HtmlTableRendererBase.java

Modified: myfaces/shared/trunk/core/src/main/java/org/apache/myfaces/shared/renderkit/html/HtmlTableRendererBase.java
URL: http://svn.apache.org/viewvc/myfaces/shared/trunk/core/src/main/java/org/apache/myfaces/shared/renderkit/html/HtmlTableRendererBase.java?rev=413904&r1=413903&r2=413904&view=diff
==============================================================================
--- myfaces/shared/trunk/core/src/main/java/org/apache/myfaces/shared/renderkit/html/HtmlTableRendererBase.java (original)
+++ myfaces/shared/trunk/core/src/main/java/org/apache/myfaces/shared/renderkit/html/HtmlTableRendererBase.java Tue Jun 13 07:13:48 2006
@@ -223,6 +223,18 @@
         // walk through the newspaper rows
         for(int nr = 0; nr < newspaperRows; nr++)
         {
+            // single column newspaper row assignment done here
+            int currentRow = nr + first;
+
+            // if this row is not to be rendered
+            if (currentRow >= last) continue;
+
+            uiData.setRowIndex(currentRow);
+            if (!uiData.isRowAvailable()) {
+                    log.error("Row is not available. Rowindex = " + currentRow);
+                    return;
+            }
+
             beforeRow(facesContext, uiData);
 
             HtmlRendererUtils.writePrettyLineSeparator(facesContext);
@@ -231,17 +243,20 @@
             // walk through the newspaper columns
             for(int nc = 0; nc < newspaperColumns; nc++) {
 
-                // the current row in the 'real' table
-                int currentRow = nc * newspaperRows + nr + first;
-                
-                // if this row is not to be rendered
-                if(currentRow >= last) continue;
-
-                // bail if any row does not exist
-                uiData.setRowIndex(currentRow);
-                if(!uiData.isRowAvailable()) {
-                    log.error("Row is not available. Rowindex = " + currentRow);
-                    return;
+                // additional newspaper column row assignment handled here
+                if (nc > 0) {
+                    // the current row in the 'real' table
+                    currentRow = nc * newspaperRows + nr + first;
+                    
+                    // if this row is not to be rendered
+                    if(currentRow >= last) continue;
+
+                    // bail if any row does not exist
+                    uiData.setRowIndex(currentRow);
+                    if(!uiData.isRowAvailable()) {
+                        log.error("Row is not available. Rowindex = " + currentRow);
+                        return;
+                    }
                 }
     
                 List children = getChildren(component);