This content has been marked as final. Show 1 reply
If your LoggerTableRow has a property to which that column is bound: i.e. if you have something like
then you can just use the built in ComboBoxTableCell:
levelCol.setCellValueFactory(new PropertyValueFactory<LoggerTableRow, String>("level"));
The combo box is creates will automatically update the level property in the LoggerTableRow object. If you need to perform further actions when that changes, then you can add listeners to those properties.
If you can't use a ComboBoxTableCell, then I think the steps to add a change listener to the selected item property of the combo box, and call commitEdit(...) when it changes. This will update the property associated to the column. If your LoggerTableRow is a POJO (no FX properties), then you may also need to override commitEdit(...) to update the associated value "by hand". Example 13-11 in the [url http://docs.oracle.com/javafx/2/ui_controls/table-view.htm#CJAGAAEE]TableView tutorial gives a fairly full example of a custom editing table cell (using a text field, but it shouldn't be too hard to generalize). Scroll down the code there to the EditingCell inner class.