I try to add CheckBoxTableCell to my TableColumn but the cell just show unchecked box regardless the value is true or false
My Object
public class Room {
private String id,type,category,floor,number;
private Boolean status;
//setter and getter
........
}
How I declare the table
@FXML
private TableView<Room> roomTable;
@FXML
private TableColumn ....
@FXML
private TableColumn<Room,Boolean> statusColumn;
public void initialize(){
....
statusColumn.setCellValueFactory(new PropertyValueFactory<Room, Boolean>("status")); // here
statusColumn.setCellFactory(CheckBoxTableCell.forTableColumn(statusColumn));
....
}
I have solve this problem with making a new variable with BooleanProperty type and change the PropertyValueFactory parameter with the new variable
the problem is I didn't want to use BooleanProperty or Property
because all my model class still use the standard type not the Property
is there a way to do that?
if not maybe i just change all my model class variable to Property variable