Below image explains how I have populated my table:
As you can see, I need to disable the Installments
column button once the Collected
column checkbox of related row is unchecked and vise versa.
Here is my approach so far :
colected_column.setCellValueFactory((TableColumn.CellDataFeatures<Member, CheckBox> param) -> {
Member mRow = param.getValue(); // type objects contained within the TableView
CheckBox checkBox = new CheckBox();
checkBox.selectedProperty().addListener((ov, old_val, new_val) -> {
// javafx.scene.control.Button typed ObservableValue returns as cell value
Button button = installments_column.getCellData(mRow);
button.setDisable(!new_val);
});
...
return new SimpleObjectProperty<>(checkBox);
}
But this approach does not meet the requirement, button stays enable all the time. Any help would be appreciable. Thank you.