Skip to Content
avatar image
Former Member

Make Table filter case-insensitive

Hi,

I am using the TableFilter.java file to filter the enteries in the table. But the problem is, the results are case sensitive. So i tried adding the following lines of code

<b>if(o1 instanceOf String && o2 instanceOf String){

String s1 = o1.toString();

String s2 = o2.toString();

return s1.compareToIgnoreCase(s2);

}</b>

just before the return statement in

private static final Comparator DEFAULT = new Comparator()

But still the filter is case sensitive.

Can you help me make it case in sensitive

Regards,

Prathamesh

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

3 Answers

  • Best Answer
    avatar image
    Former Member
    Oct 09, 2007 at 04:11 AM

    Hi

    Try with this

    s1.toUpperCase().compareToIgnoreCase(s2.toUpperCase());

    Regards

    Abhijith YS

    Add comment
    10|10000 characters needed characters exceeded

  • Oct 08, 2007 at 01:58 PM

    Are you sure that all data is of type String ? Check that first.

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Oct 12, 2007 at 06:15 AM

    Hi ,

    in your compare program you can use:

    string.equalsIgnoreCase(anotherString)

    This will definitely work.

    Feel free for any queries.

    Regard,

    Praveen

    Add comment
    10|10000 characters needed characters exceeded