Author: maksimkaszynski
Date: 2008-01-10 09:11:05 -0500 (Thu, 10 Jan 2008)
New Revision: 5264
Modified:
trunk/framework/api/src/main/java/org/richfaces/model/ScrollableTableDataModel.java
trunk/framework/impl/src/main/java/org/richfaces/model/impl/expressive/WrappedBeanComparator.java
Log:
http://jira.jboss.com/jira/browse/RF-1636
http://jira.jboss.com/jira/browse/RF-1715
Modified:
trunk/framework/api/src/main/java/org/richfaces/model/ScrollableTableDataModel.java
===================================================================
---
trunk/framework/api/src/main/java/org/richfaces/model/ScrollableTableDataModel.java 2008-01-10
14:11:03 UTC (rev 5263)
+++
trunk/framework/api/src/main/java/org/richfaces/model/ScrollableTableDataModel.java 2008-01-10
14:11:05 UTC (rev 5264)
@@ -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;
@@ -71,8 +71,19 @@
return false;
return true;
}
+ @Override
+ public double doubleValue() {
+ return i;
+ }
+ @Override
+ public float floatValue() {
+ return i;
+ }
+ @Override
+ public long longValue() {
+ return i;
+ }
-
}
Modified:
trunk/framework/impl/src/main/java/org/richfaces/model/impl/expressive/WrappedBeanComparator.java
===================================================================
---
trunk/framework/impl/src/main/java/org/richfaces/model/impl/expressive/WrappedBeanComparator.java 2008-01-10
14:11:03 UTC (rev 5263)
+++
trunk/framework/impl/src/main/java/org/richfaces/model/impl/expressive/WrappedBeanComparator.java 2008-01-10
14:11:05 UTC (rev 5264)
@@ -41,12 +41,12 @@
Object p1 = w1.getProperty(prop);
Object p2 = w2.getProperty(prop);
- if (p1 != null) {
- if (p1 instanceof Comparable && p2 != null) {
- result = ((Comparable<Object>) p1).compareTo(p2);
- } else {
- result = 1;
- }
+ if (p1 instanceof Comparable && p2 instanceof Comparable) {
+ result = ((Comparable<Object>) p1).compareTo(p2);
+ } else if (p1 == null && p2 != null) {
+ result = 1;
+ } else if (p2 == null && p1 != null) {
+ result = -1;
}
if (asc != null && !asc.booleanValue()) {