vendredi 23 octobre 2015

Don't work CheckBoxTableCell

I use CheckBoxTableCell in my project for view data. But when I ckecked several data and scrolling to down table, unchecked data becomes checked.

The first checked data enter image description here

After scrolling table enter image description here

This is my realisation:

public void loadXmlToTableView() {
        ObservableList<Tweet> data = FXCollections.observableArrayList();
        for (Tweet loop : IOoperations.getXml()) {
            data.add(loop);
        }
        retweet.setItems(data);
        colRetweetDate.setCellValueFactory(new PropertyValueFactory<Tweet, Date>("tweetDate"));
        colText.setCellValueFactory(new PropertyValueFactory<Tweet, String>("text"));
        colUserName.setCellValueFactory(new PropertyValueFactory<Tweet, String>("userName"));
        colChek.setCellValueFactory(new PropertyValueFactory<Tweet, Boolean>("selected"));
        colChek.setCellFactory(CheckBoxTableCell.forTableColumn(colChek));

        colChek.setEditable(true);
        retweet.setEditable(true);
        colChek.setMaxWidth(50);
        colChek.setMinWidth(50);
    }




Aucun commentaire:

Enregistrer un commentaire