Author: konstantin.mishin
Date: 2008-02-28 11:08:19 -0500 (Thu, 28 Feb 2008)
New Revision: 6421
Modified:
trunk/framework/impl/src/main/java/org/richfaces/model/impl/expressive/WrappedBeanComparator2.java
trunk/framework/impl/src/main/java/org/richfaces/model/impl/expressive/WrappedBeanFilter.java
Log:
RF-1741
Modified:
trunk/framework/impl/src/main/java/org/richfaces/model/impl/expressive/WrappedBeanComparator2.java
===================================================================
---
trunk/framework/impl/src/main/java/org/richfaces/model/impl/expressive/WrappedBeanComparator2.java 2008-02-28
16:03:31 UTC (rev 6420)
+++
trunk/framework/impl/src/main/java/org/richfaces/model/impl/expressive/WrappedBeanComparator2.java 2008-02-28
16:08:19 UTC (rev 6421)
@@ -43,7 +43,9 @@
Object p2 = w2.getProperty(prop);
if (p1 == p2 && p1 instanceof Comparator) {
result = ((Comparator<Object>)p1).compare(w1.getWrappedObject(),
w2.getWrappedObject());
- } else if (p1 instanceof Comparable && p2 instanceof Comparable) {
+ } else if (p1 instanceof String && p2 instanceof String) {
+ result = ((String)p1).trim().compareToIgnoreCase(((String)p2).trim());
+ } if (p1 instanceof Comparable && p2 instanceof Comparable) {
result = ((Comparable<Object>) p1).compareTo(p2);
} else if (p1 == null && p2 != null) {
result = 1;
Modified:
trunk/framework/impl/src/main/java/org/richfaces/model/impl/expressive/WrappedBeanFilter.java
===================================================================
---
trunk/framework/impl/src/main/java/org/richfaces/model/impl/expressive/WrappedBeanFilter.java 2008-02-28
16:03:31 UTC (rev 6420)
+++
trunk/framework/impl/src/main/java/org/richfaces/model/impl/expressive/WrappedBeanFilter.java 2008-02-28
16:08:19 UTC (rev 6421)
@@ -24,9 +24,12 @@
for (FilterField filterField : filterFields) {
if (filterField instanceof ExtendedFilterField) {
Object property =
wrapper.getProperty(filterField.getExpression().getExpressionString());
- final String filterValue = ((ExtendedFilterField)filterField).getFilterValue();
- if(!(filterValue == null) && !property.toString().startsWith(filterValue)) {
- return false;
+ String filterValue = ((ExtendedFilterField)filterField).getFilterValue();
+ if(filterValue != null) {
+ filterValue = filterValue.trim().toUpperCase();
+ if(!property.toString().trim().toUpperCase().startsWith(filterValue)) {
+ return false;
+ }
}
} else {
Object property =
wrapper.getProperty(filterField.getExpression().getExpressionString());
Show replies by date