Filter throws exception when some columns are hidden

Issue #37 resolved
Former user created an issue
What steps will reproduce the problem?
1. set up a table; hide some columns
2. set up filter header as normal
3. add a separate filter; the separate filter causes the crash

What is the expected output? What do you see instead?

filter the table; instead, it throws an exception.

What version of the product are you using? On what operating system?

5.1.1

Please provide any additional information below.

// create table and TableFilterHeader in the usual way
JTable table = ....
 TableFilterHeader filterHeader = new TableFilterHeader(_table, AutoChoices.ENABLED);
filterHeader.setFilterOnUpdates(true);

//now add an additional, separate filter to the header
filterHeader.addFilter(RowFilter.regexFilter("ALICE");

// the separate filter cause an exception b/c some columns are hidden (see Entry.getStringValue(...)

// if the visible columns are inserted into the regex filter, the exception is avoided
filterHeader.addFilter(RowFilter.regexFilter("ALICE",visibleColumnsIntArray);

Original issue reported on code.google.com by elisebotworld.ww on 2014-06-23 14:43:33

Comments (3)

  1. coderazzi coderazzi repo owner
    Hi, I was checking the code that you provided, but addFilter requires an IFilter instance,
    not a RowFilter.
    I still get an exception, as you point out, when I create an IFilter wrapping the RowFilter,
    doing:
    
            filterHeader.addFilter(new Filter(){
                RowFilter r = RowFilter.regexFilter("ALICE");
                @Override public boolean include(Entry entry) {
                    return r.include(entry);
                }
            });             
    
    Is this the code that you have?
    

    Original issue reported on code.google.com by coderazzi on 2014-06-25 11:26:56

  2. coderazzi coderazzi repo owner
    Solved on 5.1.2
    

    Original issue reported on code.google.com by coderazzi on 2015-03-18 22:26:18

  3. Log in to comment