Author: abelevich
Date: 2007-05-29 06:42:07 -0400 (Tue, 29 May 2007)
New Revision: 923
Modified:
trunk/sandbox/scrollable-grid/src/main/java/org/richfaces/component/UIScrollableGrid.java
Log:
Modified:
trunk/sandbox/scrollable-grid/src/main/java/org/richfaces/component/UIScrollableGrid.java
===================================================================
---
trunk/sandbox/scrollable-grid/src/main/java/org/richfaces/component/UIScrollableGrid.java 2007-05-29
10:36:33 UTC (rev 922)
+++
trunk/sandbox/scrollable-grid/src/main/java/org/richfaces/component/UIScrollableGrid.java 2007-05-29
10:42:07 UTC (rev 923)
@@ -19,7 +19,6 @@
import org.ajax4jsf.ajax.repeat.DataComponentState;
import org.ajax4jsf.ajax.repeat.DataVisitor;
import org.ajax4jsf.ajax.repeat.Range;
-import org.ajax4jsf.ajax.repeat.UIDataAdaptor;
import org.ajax4jsf.ajax.repeat.UIRepeat;
import org.ajax4jsf.framework.ajax.AjaxComponent;
import org.ajax4jsf.framework.ajax.AjaxContext;
@@ -27,7 +26,7 @@
import org.apache.commons.collections.iterators.IteratorChain;
import org.richfaces.event.sort.SortEvent;
import org.richfaces.model.BufferedSequenceRange;
-import org.richfaces.model.ScrollableGridDataModel2;
+import org.richfaces.model.ScrollableGridDataModel;
import org.richfaces.model.SortOrder;
import org.richfaces.model.visual.DefaultGridVisualModel;
import org.richfaces.model.visual.ScrollableGridVisualModel;
@@ -137,8 +136,8 @@
public void setSortOrder(SortOrder sortOrder) {
getVisualModel().setSortOrder(sortOrder);
Object value = getValue();
- if (value instanceof ScrollableGridDataModel2) {
- ScrollableGridDataModel2 gridDataModel = (ScrollableGridDataModel2) value;
+ if (value instanceof ScrollableGridDataModel) {
+ ScrollableGridDataModel gridDataModel = (ScrollableGridDataModel) value;
gridDataModel.setSortOrder(sortOrder);
}
}
@@ -259,34 +258,18 @@
boolean asc = true;
SortOrder sortOrder = getSortOrder();
- int oldSortColumn = -1;
- int newSortColumn = sortColumn;
-
+
if (sortOrder != null) {
- /**
- * toggle sort direction
- */
- oldSortColumn = sortOrder.getSortColumn();
+
if (sortOrder.getSortColumn() == sortColumn) {
asc = !sortOrder.isAscending();
}
+
}
SortOrder newSortOrder = new SortOrder(sortColumn, startRow, dataIndex, asc);
setSortOrder(newSortOrder);
resetDataModel();
-
-// setSelection(new CascadeSelection());
-// addRequestStateKey(SORT_EVENT);
- FacesContext context = getFacesContext();
-
-
-// TODO add to AjaxContext
-
-
-// if (log.isTraceEnabled()) {
-// log.trace("Sorting has changed " + sortOrder);
-// }
}
public void walk(FacesContext context, DataVisitor visitor, Object argument) throws
IOException {
Show replies by date