Author: dmorozov
Date: 2008-09-16 10:33:47 -0400 (Tue, 16 Sep 2008)
New Revision: 10450
Modified:
trunk/framework/api/src/main/java/org/richfaces/model/ScrollableTableDataModel.java
trunk/ui/scrollableDataTable/src/main/java/org/richfaces/component/UIScrollableDataTable.java
trunk/ui/scrollableDataTable/src/main/java/org/richfaces/model/internal/ComponentSortableDataModel.java
trunk/ui/scrollableDataTable/src/test/java/org/richfaces/model/internal/ComponentSortableDataModelTest.java
Log:
https://jira.jboss.org/jira/browse/RF-4367
https://jira.jboss.org/jira/browse/RF-4178
Modified:
trunk/framework/api/src/main/java/org/richfaces/model/ScrollableTableDataModel.java
===================================================================
---
trunk/framework/api/src/main/java/org/richfaces/model/ScrollableTableDataModel.java 2008-09-16
13:40:58 UTC (rev 10449)
+++
trunk/framework/api/src/main/java/org/richfaces/model/ScrollableTableDataModel.java 2008-09-16
14:33:47 UTC (rev 10450)
@@ -93,7 +93,7 @@
private Map<Object, T> mapping;
- private SortOrder lastSortOrder;
+ protected SortOrder lastSortOrder;
/**
Modified:
trunk/ui/scrollableDataTable/src/main/java/org/richfaces/component/UIScrollableDataTable.java
===================================================================
---
trunk/ui/scrollableDataTable/src/main/java/org/richfaces/component/UIScrollableDataTable.java 2008-09-16
13:40:58 UTC (rev 10449)
+++
trunk/ui/scrollableDataTable/src/main/java/org/richfaces/component/UIScrollableDataTable.java 2008-09-16
14:33:47 UTC (rev 10450)
@@ -184,7 +184,7 @@
model = (ScrollableTableDataModel<?>) value;
} else {
- model = new ComponentSortableDataModel(getVar(), value);
+ model = new ComponentSortableDataModel(getVar(), value, this.getSortOrder());
}
if (isCacheable()) {
Modified:
trunk/ui/scrollableDataTable/src/main/java/org/richfaces/model/internal/ComponentSortableDataModel.java
===================================================================
---
trunk/ui/scrollableDataTable/src/main/java/org/richfaces/model/internal/ComponentSortableDataModel.java 2008-09-16
13:40:58 UTC (rev 10449)
+++
trunk/ui/scrollableDataTable/src/main/java/org/richfaces/model/internal/ComponentSortableDataModel.java 2008-09-16
14:33:47 UTC (rev 10450)
@@ -71,8 +71,9 @@
DataModel model;
private String var;
- public ComponentSortableDataModel(String var, Object value) {
+ public ComponentSortableDataModel(String var, Object value, SortOrder sortOrder) {
this.var = var;
+ lastSortOrder = sortOrder;
setWrappedData(value);
}
Modified:
trunk/ui/scrollableDataTable/src/test/java/org/richfaces/model/internal/ComponentSortableDataModelTest.java
===================================================================
---
trunk/ui/scrollableDataTable/src/test/java/org/richfaces/model/internal/ComponentSortableDataModelTest.java 2008-09-16
13:40:58 UTC (rev 10449)
+++
trunk/ui/scrollableDataTable/src/test/java/org/richfaces/model/internal/ComponentSortableDataModelTest.java 2008-09-16
14:33:47 UTC (rev 10450)
@@ -57,7 +57,7 @@
super.setUp();
table = (UIScrollableDataTable)
application.createComponent(UIScrollableDataTable.COMPONENT_TYPE);
table.setVar("item");
- model = new ComponentSortableDataModel("item", null);
+ model = new ComponentSortableDataModel("item", null, null);
facesContext.getViewRoot().getChildren().add(table);
@@ -187,7 +187,7 @@
* Test method for {@link
org.richfaces.model.internal.ComponentSortableDataModel#ComponentSortableDataModel(javax.faces.component.UIData,
java.lang.Object)}.
*/
public final void testComponentSortableDataModel() {
- model = new ComponentSortableDataModel("item", l);
+ model = new ComponentSortableDataModel("item", l, null);
assertEquals(l.size(), model.getRowCount());
}