I have a javafx TableView displaying data grabbed from a server and put into a model.. The model data will be updated every few seconds, new rows might be added or a particular model data may be modified..
Let's say I have a column called "Priority", user clicks on the priority header to sort the table based on priority to see LOW MEDIUM HIGH priorities. When a new row is added, the row is inserted correctly based on the sort.
Here's the problem, when an existing row's data is modified, for example, I use a button to change the priority of the first row.
btn.setOnAction(new EventHandler<ActionEvent>(){
@Override
Public void handle(ActionEvent event){
data.get(0).setPriority("HIGH");
}
});
the table doesn't reflect the change immediately, nor was the table sorted. I was only able to see the modified priority when I double clicked on the cell to edit or when I resort the table..
So here's my question:
Why doesn't my table reflect the changes immediately after it's data has been changed? PS: I did set the table items using
table.setItems(data);
Is there a way for me to be notified when the data is modified, because if so I may be able to trigger some sort of refresh for my table to reflect those changes.. but I can't do that if I don't know when the data is modified