Friday, September 17, 2010

Case Insensitive Filter

On the column just set the filterFeatures attribute to caseInsensitive

CODE ALTERNATIVE

1) Map your querylistener and table binding to methods in your backing bean.

2) Implement the above mentioned methods and so what you need to the filter:

public void queryListener(QueryEvent queryEvent){
FilterableQueryDescriptor des = (FilterableQueryDescriptor)getModuleTable().getFilterModel();
Map _criteriaMap = des.getFilterCriteria();
Set featureSet = new HashSet();
featureSet.add(FilterableQueryDescriptor.FilterFeature.CASE_INSENSITIVE);
Iterator criteriaIter = _criteriaMap.keySet().iterator();
Map filterFeatures = new HashMap();
while (criteriaIter != null && criteriaIter.hasNext()){
String keyCr = (String)criteriaIter.next();
((HashMap)filterFeatures).put(keyCr, featureSet);
}
des.setFilterFeatures(filterFeatures);
JSFUtils.invokeMethodExpression("#{bindings.MdsModuleElementsVO2Query.processQuery}", Object.class, QueryEvent.class, queryEvent);
}

private RichTable moduleTable;

public void setModuleTable(RichTable moduleTable){
this.moduleTable = moduleTable;
}

public RichTable getModuleTable(){
return moduleTable;
}

No comments:

Post a Comment