I'm filling the TableView
with a ArrayList<HashMap<String, Object>>
and I'm not using a template table but getting the data from ArrayList
.
When I dial CheckBox
, I need to get data from a specific column. Does anyone have an example in this way?
I've done a lot of research and all the examples refer to a class that contains all the data.
Here is the code snippet for TableView
:
ObservableList obList = FXCollections.observableArrayList(list);
colCod.setCellValueFactory(new MapValueFactory("CAMPO0"));
colContrato.setCellValueFactory(new MapValueFactory("CAMPO7"));
colCpf.setCellValueFactory(new MapValueFactory("CAMPO1"));
colCliente.setCellValueFactory(new MapValueFactory("CAMPO2"));
colProd.setCellValueFactory(new MapValueFactory("CAMPO9"));
colValor.setCellValueFactory(new MapValueFactory("CAMPO14"));
colStatus.setCellValueFactory(new MapValueFactory("CAMPO15"));
colCk.setCellFactory(CheckBoxTableCell.forTableColumn(colCk)); //definição do checkbox