I have a tableview showing data of a record of a database.
I also have fields not in the table (in an extra pane) showing the same fields (for reason of convenience, in the table for easy sorting, outside for convenient changing)
Such; when i change a field not in the table, i need the table view changed accordingly: change -> db update -> new data into the table
- it does not work. The view is not 'refreshed' (like e.g. in microsoft products).
A hacky solution works: i re-create the table every time and set it again (everything: build the columns, the listeners, set the selected item, and set this 'new' table instead of the existing). (another suggested solution in SO, set visible(false)/(true) - it did not work).
I found another 'solution' if said so: I set the changed value into the table.field directly. However then; the changed data is not shown as changed. - Only when i as a human access the header (double-mouse-click onto the header to trigger a sorting; it will finally update the view)
I would prefer not to re-create the table entirely every time. That is why, i would like to use the 'solution'. - But, i do not want to have to double-click onto the header as a human.
Such; i tried the Fire-Event as proposed in another post of SO, as that:
Pane header = (Pane) MY_TABLE.lookup("TableHeaderRow");
// to simulate a double-click onto the 2nd table-column-header
Event.fireEvent(header.getChildren().get(1) ...
.. it does not work; but i am not sure which 'node' i had to 'robo-click' onto either ..
it is hacky; but if someone could pls point to the solution i would be grateful. .. :) pls not a solution of setting an observable list etc; i have done so, to no avail. I just would like to make this 'hack' run; not to re-create the table every time.
- if there was something like the table for javafx (java 8), maybe a private API, that offered view-updates when triggered by code; pls tell :)
Thank you!