My favorites | Sign in
Project Home Downloads Wiki Issues Source
READ-ONLY: This project has been archived. For more information see this post.
Search
for
CustomSimpleRowFilter  
Updated Sep 7, 2010 by jeff.johnston.mn@gmail.com

This is a quick example that shows how you can modify the SimpleRowFilter to do something more custom. It gets around an edge case that I was not sure what to do about yet. I thought I would take the opportunity to put a support interface in so that custom code could get a hold of the FilterMatcherRegistry to the solve problem as well.

First you need to extend the SimpleRowFilter and override the getFilterMatchers() method.

public class CustomSimpleRowFilter extends SimpleRowFilter {

    @Override
    protected Map<Filter, FilterMatcher> getFilterMatchers(Collection<?> items, FilterSet filterSet) {
        Map<Filter, FilterMatcher> filterMatchers = new HashMap<Filter, FilterMatcher>();

        FilterMatcherRegistry registry = getFilterMatcherRegistry();

        // insert custom code

        return filterMatchers;
    }
}

Then plug your custom RowFilter into the TableFacade.

  • API
  • tableModel.setRowFilter(new CustomSimpleRowFilter());
  • JSP Tag
  • <jmesa:tableModel rowFilter="com.mycompany.CustomSimpleRowFilter">
Powered by Google Project Hosting