incubator-adffaces-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mat...@apache.org
Subject svn commit: r440697 - /incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/renderkit/core/pda/PdaTableRenderer.java
Date Wed, 06 Sep 2006 12:08:02 GMT
Author: matzew
Date: Wed Sep  6 05:08:01 2006
New Revision: 440697

URL: http://svn.apache.org/viewvc?view=rev&rev=440697
Log:
header facet on the tr:table component is now supported on PDAs (ADFFACES-156).Thx for the
patch, Josef

Modified:
    incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/renderkit/core/pda/PdaTableRenderer.java

Modified: incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/renderkit/core/pda/PdaTableRenderer.java
URL: http://svn.apache.org/viewvc/incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/renderkit/core/pda/PdaTableRenderer.java?view=diff&rev=440697&r1=440696&r2=440697
==============================================================================
--- incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/renderkit/core/pda/PdaTableRenderer.java
(original)
+++ incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/renderkit/core/pda/PdaTableRenderer.java
Wed Sep  6 05:08:01 2006
@@ -175,7 +175,8 @@
     //
     // 2. Render the top / column header
     //
-    
+    _renderTableHeader(context, arc, tContext, component);
+      
     // render the column header
     if (tContext.hasColumnHeaders())
       _renderColumnHeader(context, arc, tContext, component);
@@ -494,4 +495,34 @@
     
     return cellClass;
   }
+    
+  /**
+   * @todo Reconsider our choice of style for this element!
+   */
+  private void _renderTableHeader(
+    FacesContext          context,
+    RenderingContext   arc,
+    TableRenderingContext tContext,
+    UIComponent           component)
+    throws IOException
+  {
+    // implement header facet on table: see bug 3788610
+    ResponseWriter writer = context.getResponseWriter();
+    UIComponent header = getFacet(component, CoreTable.HEADER_FACET);
+    if (header != null)
+    {
+      writer.startElement("thead", null);
+      writer.startElement(XhtmlConstants.TABLE_ROW_ELEMENT, null);
+      writer.startElement(XhtmlConstants.TABLE_DATA_ELEMENT, null);
+      writer.writeAttribute(XhtmlConstants.COLSPAN_ATTRIBUTE,
+        IntegerUtils.getInteger(tContext.getActualColumnCount()), null);
+      renderStyleClass(context, arc, XhtmlConstants.AF_COLUMN_SORTABLE_HEADER_ICON_STYLE_CLASS);
+
+      encodeChild(context, header);
+
+      writer.endElement(XhtmlConstants.TABLE_DATA_ELEMENT);
+      writer.endElement(XhtmlConstants.TABLE_ROW_ELEMENT);
+      writer.endElement("thead");
+    }
+  }    
 }



Mime
View raw message