mercredi 19 avril 2017

javafx tableview update checkbox in column programmatically

I am working in a desktop application with javafx. In my screen, I have a tableview and in the first column, i have a checkbox, defined:

    markedColumn.setCellValueFactory(cellData -> cellData.getValue().markedProperty());
    markedColumn.setCellFactory(CheckBoxTableCell.forTableColumn(new Callback<Integer, ObservableValue<Boolean>>() {
        @Override
        public ObservableValue<Boolean> call(Integer param) {
            return data.get(param).markedProperty();
        }

    }));

Then, i filtered the tableview, for other field name:

    table.setItems(table.getItems().filtered(p -> p.getName().equals(name)));

but the marked column doesn't modify.

How can i modify the checkbox's state?

Thank you very much for your attention.

Regards.




Aucun commentaire:

Enregistrer un commentaire