Author: konstantin.mishin
Date: 2008-01-22 11:45:13 -0500 (Tue, 22 Jan 2008)
New Revision: 5536
Modified:
branches/3.1.x/ui/scrollableDataTable/src/main/java/org/richfaces/renderkit/html/ScrollableDataTableBaseRenderer.java
Log:
RF-1763
Modified:
branches/3.1.x/ui/scrollableDataTable/src/main/java/org/richfaces/renderkit/html/ScrollableDataTableBaseRenderer.java
===================================================================
---
branches/3.1.x/ui/scrollableDataTable/src/main/java/org/richfaces/renderkit/html/ScrollableDataTableBaseRenderer.java 2008-01-22
14:51:49 UTC (rev 5535)
+++
branches/3.1.x/ui/scrollableDataTable/src/main/java/org/richfaces/renderkit/html/ScrollableDataTableBaseRenderer.java 2008-01-22
16:45:13 UTC (rev 5536)
@@ -72,7 +72,7 @@
int width = 0;
- String widthPx = (String)column.getAttributes().get("width");
+ String widthPx = getColumnWidth(column);
widthPx = getFormattedWidth(widthPx);
prevWidth = state.getSumWidth();
width = prevWidth + Integer.parseInt(widthPx);
@@ -86,7 +86,7 @@
public void renderContent(FacesContext context, UIComponent column, ResponseWriter
writer, ScrollableDataTableRendererState state) throws IOException {
writer.startElement("col", column);
- getUtils().writeAttribute(writer, "width",
column.getAttributes().get("width"));
+ getUtils().writeAttribute(writer, "width", getColumnWidth(column));
getUtils().writeAttribute(writer, "style",
column.getAttributes().get("style"));
//int cell_index = state.getCellIndex();
//Object columnClass = state.getColumnClass(cell_index);
@@ -108,7 +108,7 @@
ComponentVariables variables =
ComponentsVariableResolver.getVariables(headerCellTemplate, column);
- String widthPx = (String)column.getAttributes().get("width");
+ String widthPx = getColumnWidth(column);
widthPx = getFormattedWidth(widthPx);
int width = Integer.parseInt(widthPx);
@@ -885,4 +885,11 @@
return sorting;
}
+ private String getColumnWidth(UIComponent column) {
+ String width = (String) column.getAttributes().get("width");
+ if (width == null) {
+ width = "100px";
+ }
+ return width;
+ }
}
Show replies by date