I had a similar problem with refreshing. My solution was to restrict the operations on the ObservableList
to those which work correctly with bind()
.
Assume ObservableList obsList
is the underlying list for the TableView
.
Then
obsList.clear()
(inherited from java.util.List<>
) will not update the TableView
correctly but.
Also calling setItem(obsList)
did not work to trigger a refresh...but...
obsList.removeAll(obsList)
(overwritten by ObservableList
) works fine because it fires the changeEvent correctly.
Refilling a list with completely new content then works as follows:
obsList.removeAll(obsList);
obsList.add(...); //e.g. in a loop...
or
obsList.removeAll(obsList);
FXCollections.copy(obsList, someSourceList)
Best regards Ingo