I have a ListView control in a JavaFX 2 modal dialog window.
This ListView displays DXAlias instances, the ListCells for which are manufactured by a cell factory. The m
Not sure if this works in JavaFX 2.2, but it does in JavaFX 8 and took me a while to figure out. You need to create your own ListViewSkin
and add a refresh
method like:
public void refresh() {
super.flow.recreateCells();
}
This will call updateItem
without having to replace the whole Observable collection.
Also, to use the new Skin, you need to instantiate it and set it on the initialize
method of the controller in case you're using FXML:
MySkin skin = new MySkin<>(this.listView); // Injected by FXML
this.listView.setSkin(skin);
...
((MySkin) listView.getSkin()).refresh(); // This is how you use it
I found this after debugging the behavior of an Accordion. This controls refresh the ListView it contains everytime you expand it.