Author: maksimkaszynski
Date: 2008-01-10 09:11:03 -0500 (Thu, 10 Jan 2008)
New Revision: 5263
Modified:
branches/3.1.x/framework/api/src/main/java/org/richfaces/model/ScrollableTableDataModel.java
branches/3.1.x/ui/scrollableDataTable/src/main/java/org/richfaces/model/internal/WrappedBeanComparator.java
Log:
http://jira.jboss.com/jira/browse/RF-1636
http://jira.jboss.com/jira/browse/RF-1715
Modified:
branches/3.1.x/framework/api/src/main/java/org/richfaces/model/ScrollableTableDataModel.java
===================================================================
---
branches/3.1.x/framework/api/src/main/java/org/richfaces/model/ScrollableTableDataModel.java 2008-01-10
13:50:22 UTC (rev 5262)
+++
branches/3.1.x/framework/api/src/main/java/org/richfaces/model/ScrollableTableDataModel.java 2008-01-10
14:11:03 UTC (rev 5263)
@@ -34,7 +34,7 @@
* @author Maksim Kaszynski
*
*/
- public static class SimpleRowKey implements Serializable{
+ public static class SimpleRowKey extends Number implements Serializable{
private static final long serialVersionUID = 1L;
private int i;
@@ -72,6 +72,15 @@
return true;
}
+ public double doubleValue() {
+ return i;
+ }
+ public float floatValue() {
+ return i;
+ }
+ public long longValue() {
+ return i;
+ }
}
Modified:
branches/3.1.x/ui/scrollableDataTable/src/main/java/org/richfaces/model/internal/WrappedBeanComparator.java
===================================================================
---
branches/3.1.x/ui/scrollableDataTable/src/main/java/org/richfaces/model/internal/WrappedBeanComparator.java 2008-01-10
13:50:22 UTC (rev 5262)
+++
branches/3.1.x/ui/scrollableDataTable/src/main/java/org/richfaces/model/internal/WrappedBeanComparator.java 2008-01-10
14:11:03 UTC (rev 5263)
@@ -38,8 +38,12 @@
Object p1 = w1.getProperty(prop);
Object p2 = w2.getProperty(prop);
- if (p1 instanceof Comparable) {
+ if (p1 instanceof Comparable && p2 instanceof Comparable) {
result = ((Comparable) p1).compareTo(p2);
+ } else if (p1 == null && p2 != null) {
+ result = 1;
+ } else if (p2 == null && p1 != null) {
+ result = -1;
}
if (asc != null && !asc.booleanValue()) {