Problem with FilterintTable and Update

Hello all!

I am migrating our project from Vaading 6 to 7 right now. I am very pleased with it, although it is very hard work (very repetitive…)

Buuuuut my real problem is:

I am using (and heavily relying on) the FilterTable-AddOn…

I have a FilterTable in my application, which I am filling with a BeanItemContainer…

Now the data changes, I reload it, create a new BeanItemContainer and feed it to the table with

table.setContainerDataSource(beans)

The problem is, my view in the Browser is not refreshed.
I tried everything:

table.refreshRowCache();

even

table.requestRepaint();

But the data doesn’t change… When I resort the table, the changed data shows… When I change the amount of rows shown, the table also updates…

Does anyone have any idea??

Sounds like a bug got in when FilteringTable has been converted from Vaadin 6 to Vaadin 7, if that actually worked for you when you were using Vaadin 6. You should try to get the info out to the author of the add-on. He might see this post by himself, but you get better odds on it if you post a message in the add-ons official thread
here
, and link back to this thread.

Hi,

unfortunately I can’t reproduce your issue. Here is a simple example UI showing what I tried - the container changing and rendering the data in browser seems to work just fine:

package com.example.ftabletest;

import org.tepi.filtertable.FilterTable;

import com.vaadin.data.Container;
import com.vaadin.data.util.BeanItemContainer;
import com.vaadin.server.VaadinRequest;
import com.vaadin.ui.Button;
import com.vaadin.ui.Button.ClickEvent;
import com.vaadin.ui.Button.ClickListener;
import com.vaadin.ui.UI;
import com.vaadin.ui.VerticalLayout;

public class FtabletestUI extends UI {

    private FilterTable ft;
    private int containerNumber;

    @Override
    protected void init(VaadinRequest request) {
        final VerticalLayout mainLayout = new VerticalLayout();
        mainLayout.setSizeFull();
        mainLayout.setSpacing(true);
        mainLayout.setMargin(true);
        setContent(mainLayout);

        ft = new FilterTable();
        ft.setSizeFull();
        ft.setFilterBarVisible(true);
        ft.setContainerDataSource(buildContainer());
        mainLayout.addComponent(ft);
        mainLayout.setExpandRatio(ft, 1);

        Button reset = new Button("Create and set new container");
        mainLayout.addComponent(reset);
        reset.addClickListener(new ClickListener() {

            @Override
            public void buttonClick(ClickEvent event) {
                ft.setContainerDataSource(buildContainer());
            }
        });
    }

    private Container buildContainer() {
        BeanItemContainer<TestBean> cont = new BeanItemContainer<TestBean>(
                TestBean.class);
        for (int i = 0; i < 1000; i++) {
            TestBean tb = new TestBean();
            cont.addItem(tb);
            tb.setName("Item " + i + " / Container " + containerNumber);
            tb.setId(i);
        }
        containerNumber++;
        return cont;
    }

    public class TestBean {
        private String name;

        public String getName() {
            return name;
        }

        public void setName(String name) {
            this.name = name;
        }

        public int getId() {
            return id;
        }

        public void setId(int id) {
            this.id = id;
        }

        private int id;
    }
}

If you have a more specific issue, please post a bit of the code so that I can reproduce the issue.

-tepi