I've a JavaFX table defined as:
TableView<Person> table = new TableView<>;
//Person Class contains firstName,lastName & email properties
//table has three columns First Name, Last Name & Email
An ObservableList
of Person
s
ObservableList<Person> persons = FXCollections.observableArrayList();
A background service, which task is to populate the table dynamically by adding entries(Person
objects) to the ObservableList persons
.
table is binded as:
table.itemsProperty().bind(service.valueProperty());
Everything is working fine... but I've recently found that if I clear the table items by
table.getItems().clear();
It does not only clears the table, but also the ObservableList persons
. I'm wondering if this a bidirectional binding?
Even if I unbind it before calling getItems().clear()
on the table, it produces same result.
Could someone explain what the point I'm not getting here?