Author: abelevich
Date: 2010-12-15 12:32:52 -0500 (Wed, 15 Dec 2010)
New Revision: 20591
Modified:
trunk/ui/iteration/ui/src/main/java/org/richfaces/renderkit/AbstractTableBaseRenderer.java
trunk/ui/iteration/ui/src/main/java/org/richfaces/renderkit/AbstractTableRenderer.java
trunk/ui/iteration/ui/src/main/java/org/richfaces/renderkit/CollapsibleSubTableRenderer.java
trunk/ui/iteration/ui/src/main/java/org/richfaces/renderkit/DataTableRenderer.java
trunk/ui/iteration/ui/src/main/resources/META-INF/resources/org.richfaces/datatable.ecss
Log:
RF-9930, RF-9826
Modified:
trunk/ui/iteration/ui/src/main/java/org/richfaces/renderkit/AbstractTableBaseRenderer.java
===================================================================
---
trunk/ui/iteration/ui/src/main/java/org/richfaces/renderkit/AbstractTableBaseRenderer.java 2010-12-15
17:13:15 UTC (rev 20590)
+++
trunk/ui/iteration/ui/src/main/java/org/richfaces/renderkit/AbstractTableBaseRenderer.java 2010-12-15
17:32:52 UTC (rev 20591)
@@ -109,7 +109,7 @@
public void encodeFirstRowStart(ResponseWriter writer, FacesContext context, String
parentId, int currentRow, UIComponent component) throws IOException {
writer.startElement(HtmlConstants.TR_ELEMENT, component);
- String styleClass = getFirstRowClass(context, parentId);
+ String styleClass = concatClasses(getRowClass(context, parentId),
getFirstRowClass(context, parentId));
encodeStyleClass(writer, context, component, HtmlConstants.STYLE_CLASS_ATTR,
styleClass);
}
Modified:
trunk/ui/iteration/ui/src/main/java/org/richfaces/renderkit/AbstractTableRenderer.java
===================================================================
---
trunk/ui/iteration/ui/src/main/java/org/richfaces/renderkit/AbstractTableRenderer.java 2010-12-15
17:13:15 UTC (rev 20590)
+++
trunk/ui/iteration/ui/src/main/java/org/richfaces/renderkit/AbstractTableRenderer.java 2010-12-15
17:32:52 UTC (rev 20591)
@@ -164,14 +164,17 @@
int columns = getColumnsCount(dataTableBase.columns());
writer.startElement(HtmlConstants.TR_ELEMENT, dataTableBase);
+ String styleClass = (String)
dataTableBase.getAttributes().get("noDataStyleClass");
+ styleClass = concatClasses(getNoDataClass(), styleClass);
+ writer.writeAttribute(HtmlConstants.CLASS_ATTRIBUTE, styleClass, null);
+
writer.startElement(HtmlConstants.TD_ELEM, dataTableBase);
writer.writeAttribute(HtmlConstants.COLSPAN_ATTRIBUTE, columns, null);
- String styleClass = (String)
dataTableBase.getAttributes().get("noDataStyleClass");
- styleClass = styleClass != null ? getNoDataClass() + " " +
styleClass : getNoDataClass();
+ String cellStyleClass = (String)
dataTableBase.getAttributes().get("noDataCellStyleClass");
+ cellStyleClass = concatClasses( getNoDataCellClass(), cellStyleClass);
+ writer.writeAttribute(HtmlConstants.CLASS_ATTRIBUTE, cellStyleClass, null);
- writer.writeAttribute(HtmlConstants.CLASS_ATTRIBUTE, styleClass, null);
-
UIComponent noDataFacet = dataTableBase.getNoData();
if (noDataFacet != null && noDataFacet.isRendered()) {
noDataFacet.encodeAll(facesContext);
@@ -244,7 +247,7 @@
String clientId = (dataTableBase.getRelativeRowIndex() < 0) ?
dataTableBase.getClientId(facesContext) :
dataTableBase.getRelativeClientId(facesContext);
writer.writeAttribute(HtmlConstants.ID_ATTRIBUTE, clientId + ":tb",
null);
- writer.writeAttribute(HtmlConstants.CLASS_ATTRIBUTE, getTableSkinClass(), null);
+ writer.writeAttribute(HtmlConstants.CLASS_ATTRIBUTE, getTableBodySkinClass(),
null);
encodeStyle(writer, facesContext, dataTableBase, null);
}
@@ -272,7 +275,7 @@
writer.startElement(HtmlConstants.TFOOT_ELEMENT, dataTable);
writer.writeAttribute(HtmlConstants.ID_ATTRIBUTE, footerClientId, null);
- writer.writeAttribute(HtmlConstants.CLASS_ATTRIBUTE,
"rd-dt-tfoot", null);
+ writer.writeAttribute(HtmlConstants.CLASS_ATTRIBUTE,
"rf-dt-tft", null);
}
int columns = getColumnsCount(dataTable);
@@ -369,7 +372,7 @@
writer.startElement(HtmlConstants.THEAD_ELEMENT, dataTable);
writer.writeAttribute(HtmlConstants.ID_ATTRIBUTE, headerClientId, null);
- writer.writeAttribute(HtmlConstants.CLASS_ATTRIBUTE,
"rf-dt-thead", null);
+ writer.writeAttribute(HtmlConstants.CLASS_ATTRIBUTE,
"rf-dt-thd", null);
}
int columns = getColumnsCount(dataTable);
@@ -538,6 +541,8 @@
public abstract String getTableSkinClass();
+ public abstract String getTableBodySkinClass();
+
public abstract String getFirstRowSkinClass();
public abstract String getRowSkinClass();
@@ -569,6 +574,8 @@
public abstract String getCellSkinClass();
public abstract String getNoDataClass();
+
+ public abstract String getNoDataCellClass();
protected abstract void setupTableStartElement(FacesContext context, UIComponent
component);
Modified:
trunk/ui/iteration/ui/src/main/java/org/richfaces/renderkit/CollapsibleSubTableRenderer.java
===================================================================
---
trunk/ui/iteration/ui/src/main/java/org/richfaces/renderkit/CollapsibleSubTableRenderer.java 2010-12-15
17:13:15 UTC (rev 20590)
+++
trunk/ui/iteration/ui/src/main/java/org/richfaces/renderkit/CollapsibleSubTableRenderer.java 2010-12-15
17:32:52 UTC (rev 20591)
@@ -367,10 +367,21 @@
}
public String getNoDataClass() {
+ return "rf-cst-nd";
+ }
+
+ @Override
+ public String getNoDataCellClass() {
return "rf-cst-nd-c";
}
@Override
+ public String getTableBodySkinClass() {
+ // AbstractSubTable doesn't have tbody
+ return null;
+ }
+
+ @Override
public void encodeMetaComponent(FacesContext facesContext, UIComponent component,
String metaComponentId)
throws IOException {
AbstractCollapsibleSubTable subTable = (AbstractCollapsibleSubTable)component;
Modified:
trunk/ui/iteration/ui/src/main/java/org/richfaces/renderkit/DataTableRenderer.java
===================================================================
---
trunk/ui/iteration/ui/src/main/java/org/richfaces/renderkit/DataTableRenderer.java 2010-12-15
17:13:15 UTC (rev 20590)
+++
trunk/ui/iteration/ui/src/main/java/org/richfaces/renderkit/DataTableRenderer.java 2010-12-15
17:32:52 UTC (rev 20591)
@@ -378,8 +378,18 @@
}
public String getNoDataClass() {
- return "rf-dt-ndt";
+ return "rf-dt-nd";
}
+
+ @Override
+ public String getNoDataCellClass() {
+ return "rf-dt-nd-c";
+ }
+
+ @Override
+ public String getTableBodySkinClass() {
+ return "rf-dt-b";
+ }
protected void setupTableStartElement(FacesContext context, UIComponent component) {
setupTableStartElement(context, component, HtmlConstants.TH_ELEM);
Modified:
trunk/ui/iteration/ui/src/main/resources/META-INF/resources/org.richfaces/datatable.ecss
===================================================================
---
trunk/ui/iteration/ui/src/main/resources/META-INF/resources/org.richfaces/datatable.ecss 2010-12-15
17:13:15 UTC (rev 20590)
+++
trunk/ui/iteration/ui/src/main/resources/META-INF/resources/org.richfaces/datatable.ecss 2010-12-15
17:32:52 UTC (rev 20591)
@@ -32,7 +32,7 @@
padding:4px;
}
-.rf-dt-ndt{
+.rf-dt-nd{
border-bottom-width:'#{richSkin.tableBorderWidth}';
border-bottom-style:solid;
border-bottom-color:'#{richSkin.tableBorderColor}';