I have a grid containing data that might have special characters (e.g. á, ö, é).
I already configured my columns so that, when sorted, the grid will know to ignore and treat the special characters like normal (e.g. a, o, e)
Collator insenstiveStringComparator = Collator.getInstance();
insenstiveStringComparator.setStrength(Collator.PRIMARY);
grid.addColumn(Person::getLast_name)
.setHeader("Last Name")
.setComparator((person1, person2) -> insenstiveStringComparator.compare(person1.getLast_name().toLowerCase(), person2.getLast_name().toLowerCase()));
What can be done so that the same idea can be done for a Filter Row?
For example, what I currently have ignores special the special character é
if I type in e
in the Filter TextField:
TextField field = new TextField();
ValueProvider<Person, String> valueProvider = iterator2.next();
field.addValueChangeListener(event -> {
dataProvider.addFilter(person -> StringUtils.containsIgnoreCase(
valueProvider.apply(person), field.getValue()));});
field.setValueChangeMode(ValueChangeMode.EAGER);
filterRow.getCell(column).setComponent(field);
field.setSizeFull();
field.setPlaceholder("Filter");