Reputation: 95
I want to disable a button when the number of selected rows in a tableview is different from 1 using bind property. Is possible? Thanks and sorry for my english
Upvotes: 2
Views: 335
Reputation: 82451
Use Bindings.size
on the selectedIndices
list of the selection model:
button.disableProperty().bind(Bindings.size(tableView.getSelectionModel().getSelectedIndices())
.isNotEqualTo(1));
Upvotes: 4