@jmmk You can detect a click on the tableview and deselect if there is no item in the row below the cursor, or if the cursor is not over a row. To allow blank rows to be selected would be bad though.
j
jmmk
02/04/2018, 9:22 PM
@edvin I couldn't figure out how to detect a blank row with the click event. Is that straightforward?
e
edvin
02/04/2018, 9:29 PM
No, unfortunately not at all. JavaFX doesn't expose neat ways to get to this data easily, but a quick and dirty solution would be:
edvin
02/04/2018, 9:30 PM
setOnMouseClicked {
if (it.pickResult.intersectedNode.toString().endsWith("'null'"))
selectionModel.clearSelection()
}
j
jmmk
02/04/2018, 10:30 PM
@edvin thanks, that should work
e
edvin
02/05/2018, 5:55 PM
It's not pretty though 🙂 I'll look for better ways to do this and expose it as a function once we've converted to Java 9.