I have a case where I need to filter out an ObservableList<Item> based on some properties of the elements (i.e. the condition is internal, not external). I found out that javafx has a FilteredList , so I tried. I could set the predicate and filtering until the property value that defines the filtering changes. The predicate is now configured as follows:
list.setPredicate(t -> !t.filteredProperty().get())
Since the predicate returns boolean, not BooleanProperty, changes to this property are not reflected in the list.
Is there an easy solution to this? I could try to do some workarounds, for example. create a separate list and synchronize this, or reset the predicate every time the property changes in one element, hoping to restart the filtering, but first I wanted to ask if someone knows a pretty acceptable solution, since these workarounds are certainly not.
javafx javafx-8
Bjarne bostrรถm
source share