Ruslan  Gabbazov
Ruslan Gabbazov

Reputation: 772

JavaFX - bug in cell render after hiding columns

First of all sorry for my English:) I have a strange bug... I'd like to hide some columns in JavaFX TableView after pressing the button. The code is as simple as possible:

                column8.visibleProperty().set(false);
                column9.visibleProperty().set(false);

(I also tested with remove with the same result). The problem is that in "neighboring cell" I have "separator" from somewhere after this action. I use Cellfactories is my code. For one of the hidden Cell it is

column8.setCellFactory(column -> {
    return new TableCell<Anfrage, Mandant>() {
        @Override
        protected void updateItem(Mandant item, boolean empty) {                    
            super.updateItem(item, empty);
            if (item == null || empty) {
                setText(null);
            } else {  
                setText(item.getNameMandant());                       
            }
        }                                
    };                       
}); 

And for cell, where I have "separator" after hiding:

//Store
column10.setCellFactory(column -> {
    return new TableCell<Anfrage, Terminals>() {
        @Override
        protected void updateItem(Terminals item, boolean empty) {                    
            super.updateItem(item, empty);
            if (item == null || empty) {
                setText(null);
            } else {  
                setText(item.getStore());                     
            }
        }                                
    };                       
});  

Some pics to explain what is actually wrong. Before hiding After hiding

If i set visible to "true" again everythings works as expected - all columns are in there without any "separators" anywhere.

Thanks a lot for any advice!

Upvotes: 0

Views: 115

Answers (1)

Ruslan  Gabbazov
Ruslan Gabbazov

Reputation: 772

So, finally tableview refreshing is resolved in JavaFX 8u60. Now "native" table.refresh() do the trick.

Upvotes: 1

Related Questions