I have a TextField that also implements Predicate public class FilterStringTextField<T> extends TextField implements SerializablePredicate<T>
so it can be used in MultiSelectListBox.getListDataView().setFilter(...)
Everytime something is typed in the textfield, it calls setFilter. The implementation of predicate may vary, but usually is “if the textfield is empty return true, else do a case insensitive contains”. This initially seems to work perfectly. So first all are shown:
Have you implemented hashCode() and equals()? I haven’t tried MultiSelectListBox, but other Vaadin components such as grid and select won’t work correctly if those methods aren’t producing a correct result.
Yes I have. But if equals and hashcode were the cause, then the behavior would not be as predictable as it is now: it always keeps the presentation model index selected, not the data model index.