Author: konstantin.mishin
Date: 2008-03-26 13:27:27 -0400 (Wed, 26 Mar 2008)
New Revision: 7272
Modified:
trunk/ui/dataTable/src/main/java/org/richfaces/renderkit/AbstractTableRenderer.java
Log:
RF-2779
Modified:
trunk/ui/dataTable/src/main/java/org/richfaces/renderkit/AbstractTableRenderer.java
===================================================================
---
trunk/ui/dataTable/src/main/java/org/richfaces/renderkit/AbstractTableRenderer.java 2008-03-26
17:20:05 UTC (rev 7271)
+++
trunk/ui/dataTable/src/main/java/org/richfaces/renderkit/AbstractTableRenderer.java 2008-03-26
17:27:27 UTC (rev 7272)
@@ -590,7 +590,7 @@
org.richfaces.component.UIColumn col =
(org.richfaces.component.UIColumn) column;
if (sortableColumn) {
- String imageUrl;
+ String imageUrl = null;
if (Ordering.ASCENDING.equals(col.getSortOrder())) {
if (null != col.getSortIconAscending()) {
imageUrl = col.getSortIconAscending();
@@ -603,7 +603,7 @@
} else {
imageUrl = getResource(TriangleIconDown.class.getName()).getUri(context, null);
}
- } else {
+ } else if (col.isSelfSorted()) {
if (null != col.getSortIcon()) {
imageUrl = col.getSortIcon();
} else {
@@ -611,13 +611,18 @@
}
}
- writer.startElement(HTML.IMG_ELEMENT, column);
- writer.writeAttribute(HTML.src_ATTRIBUTE, imageUrl, null);
- writer.writeAttribute(HTML.width_ATTRIBUTE, "15", null);
- writer.writeAttribute(HTML.height_ATTRIBUTE, "15", null);
- writer.writeAttribute(HTML.class_ATTRIBUTE, "dr-table-header-sort-img",
null);
- writer.endElement(HTML.IMG_ELEMENT);
-
+ if (imageUrl != null) {
+ writer.startElement(HTML.IMG_ELEMENT, column);
+ writer.writeAttribute(HTML.src_ATTRIBUTE, imageUrl,
+ null);
+ writer.writeAttribute(HTML.width_ATTRIBUTE, "15", null);
+ writer
+ .writeAttribute(HTML.height_ATTRIBUTE, "15",
+ null);
+ writer.writeAttribute(HTML.class_ATTRIBUTE,
+ "dr-table-header-sort-img", null);
+ writer.endElement(HTML.IMG_ELEMENT);
+ }
writer.endElement(HTML.SPAN_ELEM);
}