diff --git a/explorer/src/main/kotlin/com/r3corda/explorer/views/CashViewer.kt b/explorer/src/main/kotlin/com/r3corda/explorer/views/CashViewer.kt index 5230d93a21..05ff74d279 100644 --- a/explorer/src/main/kotlin/com/r3corda/explorer/views/CashViewer.kt +++ b/explorer/src/main/kotlin/com/r3corda/explorer/views/CashViewer.kt @@ -177,7 +177,13 @@ class CashViewer : View() { class Selected(val node: ViewerNode) : ViewerNodeSelection() } - val selectedViewerNode = SimpleObjectProperty(ViewerNodeSelection.None) + val selectedViewerNode = Bindings.createObjectBinding({ + if (cashViewerTable.selectionModel.selectedItems.size == 0) { + ViewerNodeSelection.None + } else { + ViewerNodeSelection.Selected(cashViewerTable.selectionModel.selectedItems[0].value) + } + }, arrayOf(cashViewerTable.selectionModel.selectedItems)) data class StateRow ( val originated: LocalDateTime, @@ -262,19 +268,6 @@ class CashViewer : View() { } } - cashViewerTable.setOnMouseClicked { event: MouseEvent -> - if (event.button == MouseButton.PRIMARY) { - val selected = cashViewerTable.selectedItem - selectedViewerNode.set( - if (selected == null) { - ViewerNodeSelection.None - } else { - ViewerNodeSelection.Selected(selected) - } - ) - } - } - Bindings.bindContent(topSplitPane.items, panesShown) rightPane.visibleProperty().bind(EasyBind.map(selectedViewerNode) {