Author: maksimkaszynski
Date: 2008-03-24 12:35:01 -0400 (Mon, 24 Mar 2008)
New Revision: 7123
Modified:
trunk/ui/scrollableDataTable/src/main/java/org/richfaces/event/sort/MultiColumnSortListener.java
trunk/ui/scrollableDataTable/src/main/java/org/richfaces/event/sort/SingleColumnSortListener.java
trunk/ui/scrollableDataTable/src/main/java/org/richfaces/renderkit/html/ColumnWalker.java
trunk/ui/scrollableDataTable/src/main/java/org/richfaces/renderkit/html/ScrollableDataTableBaseRenderer.java
trunk/ui/scrollableDataTable/src/main/templates/org/richfaces/scrollable-data-table-header-cell.jspx
Log:
http://jira.jboss.com/jira/browse/RF-2293
Modified:
trunk/ui/scrollableDataTable/src/main/java/org/richfaces/event/sort/MultiColumnSortListener.java
===================================================================
---
trunk/ui/scrollableDataTable/src/main/java/org/richfaces/event/sort/MultiColumnSortListener.java 2008-03-24
16:34:52 UTC (rev 7122)
+++
trunk/ui/scrollableDataTable/src/main/java/org/richfaces/event/sort/MultiColumnSortListener.java 2008-03-24
16:35:01 UTC (rev 7123)
@@ -8,9 +8,9 @@
import java.util.LinkedList;
import java.util.List;
+import javax.faces.component.UIComponent;
import javax.faces.context.FacesContext;
-import org.richfaces.component.Column;
import org.richfaces.component.UIScrollableDataTable;
import org.richfaces.component.util.ColumnUtil;
import org.richfaces.model.SortField;
@@ -35,8 +35,8 @@
UIScrollableDataTable grid = (UIScrollableDataTable) e.getComponent();
int columnIndex = e.getSortColumn();
- Column column =
- (Column) grid.getChildren().get(columnIndex);
+ UIComponent column =
+ grid.getChildren().get(columnIndex);
String name = ColumnUtil.getColumnSorting(column);
Modified:
trunk/ui/scrollableDataTable/src/main/java/org/richfaces/event/sort/SingleColumnSortListener.java
===================================================================
---
trunk/ui/scrollableDataTable/src/main/java/org/richfaces/event/sort/SingleColumnSortListener.java 2008-03-24
16:34:52 UTC (rev 7122)
+++
trunk/ui/scrollableDataTable/src/main/java/org/richfaces/event/sort/SingleColumnSortListener.java 2008-03-24
16:35:01 UTC (rev 7123)
@@ -3,9 +3,9 @@
*/
package org.richfaces.event.sort;
+import javax.faces.component.UIComponent;
import javax.faces.context.FacesContext;
-import org.richfaces.component.Column;
import org.richfaces.component.UIScrollableDataTable;
import org.richfaces.component.util.ColumnUtil;
import org.richfaces.model.SortField;
@@ -28,8 +28,8 @@
public void processSort(SortEvent e) {
UIScrollableDataTable grid = (UIScrollableDataTable) e.getComponent();
int columnIndex = e.getSortColumn();
- Column column =
- (Column) grid.getChildren().get(columnIndex);
+ UIComponent column =
+ grid.getChildren().get(columnIndex);
String name = ColumnUtil.getColumnSorting(column);
Modified:
trunk/ui/scrollableDataTable/src/main/java/org/richfaces/renderkit/html/ColumnWalker.java
===================================================================
---
trunk/ui/scrollableDataTable/src/main/java/org/richfaces/renderkit/html/ColumnWalker.java 2008-03-24
16:34:52 UTC (rev 7122)
+++
trunk/ui/scrollableDataTable/src/main/java/org/richfaces/renderkit/html/ColumnWalker.java 2008-03-24
16:35:01 UTC (rev 7123)
@@ -6,6 +6,7 @@
import java.io.IOException;
import java.util.Iterator;
+import javax.faces.component.UIColumn;
import javax.faces.component.UIComponent;
import javax.faces.context.FacesContext;
import javax.faces.context.ResponseWriter;
@@ -38,7 +39,7 @@
for (Iterator<UIComponent> iter = component.getChildren().iterator();
iter.hasNext(); ) {
UIComponent kid = (UIComponent) iter.next();
if (kid.isRendered()) {
- if (kid instanceof Column){
+ if (kid instanceof Column || kid instanceof UIColumn){
columnsCount += visitor.visit(context, kid, writer, state);
state.nextCell();
}
Modified:
trunk/ui/scrollableDataTable/src/main/java/org/richfaces/renderkit/html/ScrollableDataTableBaseRenderer.java
===================================================================
---
trunk/ui/scrollableDataTable/src/main/java/org/richfaces/renderkit/html/ScrollableDataTableBaseRenderer.java 2008-03-24
16:34:52 UTC (rev 7122)
+++
trunk/ui/scrollableDataTable/src/main/java/org/richfaces/renderkit/html/ScrollableDataTableBaseRenderer.java 2008-03-24
16:35:01 UTC (rev 7123)
@@ -6,6 +6,7 @@
import java.util.Map;
import javax.faces.FacesException;
+import javax.faces.component.UIColumn;
import javax.faces.component.UIComponent;
import javax.faces.context.ExternalContext;
import javax.faces.context.FacesContext;
@@ -21,7 +22,6 @@
import org.ajax4jsf.renderkit.RendererUtils.HTML;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
-import org.richfaces.component.Column;
import org.richfaces.component.UIScrollableDataTable;
import org.richfaces.component.util.ColumnUtil;
import org.richfaces.event.scroll.ScrollEvent;
@@ -334,7 +334,7 @@
if (kid.isRendered()) {
- if (kid instanceof Column){
+ if (kid instanceof UIColumn){
if(state.isFrozenColumn() && !frozenTRRendered &&
state.getFrozenColumnCount() > 0){
state.setFrozenPart(true);
@@ -642,9 +642,9 @@
}
- Column column = (Column)grid.getChildren().get(sortColumn);
+ UIComponent column = (UIComponent)grid.getChildren().get(sortColumn);
- if(column.isSortable()){
+ if(ColumnUtil.isSortable(column)){
sorted = true;
SortEvent sortEvent = new SortEvent(grid,sortColumn, grid.getRows(),
sortDataIndex);
@@ -933,8 +933,8 @@
Boolean sorting = null;
- Column column =
- (Column) grid.getChildren().get(columnIndex);
+ UIComponent column =
+ grid.getChildren().get(columnIndex);
String name = ColumnUtil.getColumnSorting(column);
Modified:
trunk/ui/scrollableDataTable/src/main/templates/org/richfaces/scrollable-data-table-header-cell.jspx
===================================================================
---
trunk/ui/scrollableDataTable/src/main/templates/org/richfaces/scrollable-data-table-header-cell.jspx 2008-03-24
16:34:52 UTC (rev 7122)
+++
trunk/ui/scrollableDataTable/src/main/templates/org/richfaces/scrollable-data-table-header-cell.jspx 2008-03-24
16:35:01 UTC (rev 7123)
@@ -16,7 +16,7 @@
<jsp:scriptlet>
- if(Boolean.TRUE.equals(component.getAttributes().get("sortable"))) {
+ if(org.richfaces.component.util.ColumnUtil.isSortable(component)) {
getUtils().writeAttribute(writer, "style", "cursor:pointer" );
}