Using JavaFX 8 new feature SortedList, binded to a TableView sorting comparator. my implementation looks like :
SortedList<T> sorted = myObservableList.sorted();
myTable.setItems(sorted);
sorted.comparatorProperty().bind(myTable.comparatorProperty());
myObservableList
is an empty ObservableList
at startup.
I set myTable
comparator property through FXML.
My use case is :
myObservableList
with data (sorting and display are working bot fine)myObservableList
-> throw java.lang.ArrayIndexOutOfBoundsException
with a negative indexmyObservableList
with some other dataI don't know why clearing the backed list myObservableList
throws an error. Why the sortedlist is looking for indices while clearing ?
I tried first to clear the sorted list, but this operation not supported.
I upgraded to the latest build Build b114
and that fixes the bug, as it really sounds like an FX bug
But, be careful, now the addAll() breaks, need to create a for loop and call add().