Author: nbelaevski
Date: 2009-03-19 16:36:06 -0400 (Thu, 19 Mar 2009)
New Revision: 13042
Modified:
trunk/ui/dataTable/src/main/java/org/richfaces/renderkit/AbstractTableRenderer.java
Log:
https://jira.jboss.org/jira/browse/RF-6555
Modified:
trunk/ui/dataTable/src/main/java/org/richfaces/renderkit/AbstractTableRenderer.java
===================================================================
---
trunk/ui/dataTable/src/main/java/org/richfaces/renderkit/AbstractTableRenderer.java 2009-03-19
20:26:10 UTC (rev 13041)
+++
trunk/ui/dataTable/src/main/java/org/richfaces/renderkit/AbstractTableRenderer.java 2009-03-19
20:36:06 UTC (rev 13042)
@@ -341,21 +341,34 @@
UIDataTable table = (UIDataTable) holder.getTable();
ResponseWriter writer = context.getResponseWriter();
Iterator<UIComponent> iter = table.columns();
- boolean first = holder.getRowCounter() == 0;
+ boolean firstColumn = true;
+ boolean firstRow = (holder.getRowCounter() == 0);
int currentColumn = 0;
UIComponent column = null;
while (iter.hasNext()) {
column = (UIComponent) iter.next();
// Start new row for first column - expect a case of the detail
// table, wich will be insert own row.
- if (first && !(column instanceof Row)) {
- encodeRowStart(context, getFirstRowSkinClass(),
+ if (firstColumn && !(column instanceof Row)) {
+ String rowSkinClass = getRowSkinClass();
+ if (firstRow) {
+ String firstRowSkinClass = getFirstRowSkinClass();
+ if (firstRowSkinClass != null && firstRowSkinClass.length() != 0) {
+ if (rowSkinClass != null && rowSkinClass.length() != 0) {
+ rowSkinClass += " " + firstRowSkinClass;
+ } else {
+ rowSkinClass = firstRowSkinClass;
+ }
+ }
+ }
+
+ encodeRowStart(context, rowSkinClass,
holder.getRowClass(), table, writer);
}
if (column instanceof Column) {
boolean breakBefore = ((Column) column).isBreakBefore()
|| column instanceof Row;
- if (breakBefore && !first) {
+ if (breakBefore && !firstColumn) {
// close current row
writer.endElement(HTML.TR_ELEMENT);
// reset columns counter.
@@ -369,7 +382,7 @@
}
encodeCellChildren(context, column,
- first ? getFirstRowSkinClass() : null,
+ firstRow ? getFirstRowSkinClass() : null,
getRowSkinClass(), holder.getRowClass(),
getCellSkinClass(), holder.getColumnClass(currentColumn));
// renderChild(context, column);
@@ -392,10 +405,10 @@
writer.endElement(HTML.td_ELEM);
}
currentColumn++;
- first = false;
+ firstColumn = false;
}
// Close row if then is open.
- if (!first && !(column instanceof Row)) {
+ if (!firstColumn && !(column instanceof Row)) {
writer.endElement(HTML.TR_ELEMENT);
}
}