cancel
Showing results for 
Search instead for 
Did you mean: 

Filter for exact value by using the generic table filter

Former Member
0 Kudos

Hello everybody,

I am using the generic filter class and it is working well.

But I have the following problem:

For instance I would like to filter my table with the value "test", and suppose there are

other entries which have "test" as a subtring. Everytime I am filtering for "test", I get

all entries which are containing the "test" string. Is there a way to filter for a exact string?

I have tried to use the prefix "=", but it seems that I am getting the same result like without the "=".

Can anybody help me with this issue?

Best regards

Joachim

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi,

Search for the if (o1 instanceof String && o2 instanceof String) in TableFilter.java and replace the if block with the below code.

if (o1 instanceof String && o2 instanceof String) {

Collator collate = Collator.getInstance(WDResourceHandler

.getCurrentSessionLocale());

if (o1.toString().toUpperCase( WDResourceHandler.getCurrentSessionLocale()) .equalsIgnoreCase(o2.toString().toUpperCase(WDResourceHandler.getCurrentSessionLocale()))) {

return o1.toString().toUpperCase(WDResourceHandler.getCurrentSessionLocale()).indexOf(

o2.toString().toUpperCase(WDResourceHandler .getCurrentSessionLocale()));

} else {

return -1;

}

}

Regards,

Sudhir

0 Kudos

Hi Sudhir,

thank you very much for that code snippet :-).

Best regards

Joachim

Answers (0)