http://adfbugs.blogspot.com/2010/07/making-view-criteria-case-insensitive.html
Yet this has 2 side effects.
- It makes values of criteria upercase.
- It brakes MDS save criteria functionality.
I found a simpler solution (workaround).
/**
* Set the view criteria rows to use case-insensitive querying and
* uppercase any of the non-null query-by-example criteria provided.
*/
private void doCaseInsensitiveOnStringsInViewCriteria() {
ViewCriteria[] vclist = getApplyViewCriterias(ViewCriteria.CRITERIA_MODE_QUERY);
if (vclist.length>0) {
for (ViewCriteria vc : vclist){
if (!vc.isUpperColumns())
vc.setUpperColumns(true);
}
}
}
@Override
protected void executeQueryForCollection(Object object, Object[] object2 int i) {
doCaseInsensitiveOnStringsInViewCriteria();
super.executeQueryForCollection(object, object2, i);
}
This code makes query criteria Case insensitive and also does not make values of criteria upercase.Yet it still brake MDS .
Sice we need this in LOV criteria that does not have Save search, we can prevent this code to execute in LOVs using :
if (this.getName().contains("LOCAL_VIEW_USAGE"))
doCaseInsensitiveOnStringsInViewCriteria();
Test case:
http://adfbugs.googlecode.com/files/MDSTestUpper.zip