Empty Cell when scrolling table

I’m using vaadin table component to display user information. I have used various vaadin component inside table.
Button ,CssLayout, Label

i’m using table.addgeneratedColumn to generate Comlumn that contains component.

I have no clue whats going wrong, if anyone ever faced it please share your solution or if you guys have any idea what could be the problem please share.

It would be much easier to help if you posted some code which replicates the problem. Without that, my first guess would be that you don’t create a new component instance for each cell/row but rather reuse one instance. That way, the component will be at the last generated cell and the other ones will be empty, because one component instance can only be in one location at a time.

table.addGeneratedColumn(“view details”,new ColumnGenerator() {

        public Object generateCell(Table source, Object itemId,
                Object columnId) {
            
            if (columnId.equals("view details")) {

                                                                          Button view = new Button("");     
                                                                          view.setIcon(new ThemeResource("icons/button/viewDetails.png"));
                                                                          view.setImmediate(true);
                                                                          view.addListener(new Button.ClickListener() {
                                                                          public void buttonClick(ClickEvent event) {
                                                                            Viewdetails(itemId);
                                                                                }
                                                                                 });

                                                                         return view;
                                                                  }

else
return null;}

see attached file
when scrolling button is bad displayed and there is empty cell

13344.png

Which Vaadin version are you using? I remember facing this issue myself long ago, but that was on some early 6.x version. I think the issue was fixed and at least I haven’t seen it since. Unfortunately I could not find the relevant ticket at dev.vaadin.com.