Author: abelevich
Date: 2010-12-22 10:14:43 -0500 (Wed, 22 Dec 2010)
New Revision: 20744
Modified:
trunk/ui/iteration/ui/src/main/java/org/richfaces/component/UIDataTableBase.java
trunk/ui/iteration/ui/src/main/java/org/richfaces/renderkit/SortingFilteringRowsRenderer.java
Log:
RF-9931
Modified:
trunk/ui/iteration/ui/src/main/java/org/richfaces/component/UIDataTableBase.java
===================================================================
---
trunk/ui/iteration/ui/src/main/java/org/richfaces/component/UIDataTableBase.java 2010-12-22
14:52:52 UTC (rev 20743)
+++
trunk/ui/iteration/ui/src/main/java/org/richfaces/component/UIDataTableBase.java 2010-12-22
15:14:43 UTC (rev 20744)
@@ -117,7 +117,7 @@
public abstract Collection<Object> getSelection();
@Attribute
- public abstract Collection<?> getSortPriority();
+ public abstract Collection<Object> getSortPriority();
@Attribute
public abstract SortMode getSortMode();
Modified:
trunk/ui/iteration/ui/src/main/java/org/richfaces/renderkit/SortingFilteringRowsRenderer.java
===================================================================
---
trunk/ui/iteration/ui/src/main/java/org/richfaces/renderkit/SortingFilteringRowsRenderer.java 2010-12-22
14:52:52 UTC (rev 20743)
+++
trunk/ui/iteration/ui/src/main/java/org/richfaces/renderkit/SortingFilteringRowsRenderer.java 2010-12-22
15:14:43 UTC (rev 20744)
@@ -24,8 +24,7 @@
import java.util.Collection;
import java.util.Iterator;
-import java.util.LinkedList;
-import java.util.List;
+import java.util.LinkedHashSet;
import java.util.Map;
import javax.el.ELContext;
@@ -95,7 +94,13 @@
}
protected void decodeSorting(FacesContext context, UIDataTableBase dataTableBase,
String value) {
- List<Object> sortPriority = new LinkedList<Object>();
+
+ Collection<Object> sortPriority = dataTableBase.getSortPriority();
+
+ if(sortPriority == null) {
+ sortPriority = new LinkedHashSet<Object>();
+ }
+
String[] values = value.split(SEPARATOR);
if (Boolean.parseBoolean(values[2]) ||
SortMode.single.equals(dataTableBase.getSortMode())) {
for (Iterator<UIComponent> iterator = dataTableBase.columns();
iterator.hasNext();) {
@@ -109,10 +114,10 @@
}
} else {
updateSortOrder(context, dataTableBase.findComponent(values[0]), values[1]);
- Collection<?> priority = dataTableBase.getSortPriority();
- if (priority != null) {
- priority.remove(values[0]);
- sortPriority.addAll(priority);
+ sortPriority = dataTableBase.getSortPriority();
+ if (sortPriority != null) {
+ sortPriority.remove(values[0]);
+ sortPriority.addAll(sortPriority);
}
sortPriority.add(values[0]);
}
Show replies by date