Table doesn't load items with row selection active

Hello everyone,

I’ve got this really crazy bug in my Vaadin app that drives me mad for a whole day now. I’ve got a regular Vaadin
Table
with several thousands of rows. The view loads these
lazily
from the server by default, and shows the number of rows it is currently loading in case that the user scrolls really fast. That’s all very nice.

However, as soon as I
select
any row in the table, the
lazy loading stops working
. The table component won’t request any more data from the container, not even the “loading indicator numbers” show up.

I tried to reproduce this behaviour in a small example, but alas I couldn’t do it - it always works fine in a minimal example, no matter what I do.

My only hope is:
has anybody ever encountered this before
? I’m using Vaadin 7.3.10., the issue occurs on all browsers. I don’t get any errors, neither on the server, nor in the JavaScript console of my browsers…

I’d be very grateful for any advice, I’m really at loss what could cause this…

Martin

Oh boy… after searching the ENTIRE day, I finally found the cause. In the end, the table was not to blame at all, it was my UI class. In order to close floating Vaadin Windows when the user clicks outside the window, I’ve installed the following click handler:

    private Object windowLock;

    private void installFloatingWindowCloseListener() {
        this.addClickListener(e -> this.closeFloatingWindows());
    }

    protected void closeFloatingWindows() {
        // synchronize access to the list of windows to avoid ConcurrentModificationExceptions
        synchronized (this.windowLock) {
            Set<Window> openWindows = new HashSet<Window>();
            for (Window window : this.getWindows()) {
                openWindows.add(window);
            }
            for (Window window : openWindows) {
                window.close();
            }
        }
    }

    @Override
    public void addWindow(final Window window) {
        // synchronize access to the list of windows to avoid ConcurrentModificationExceptions
        synchronized (this.windowLock) {
            super.addWindow(window);
        }
    }

I’m not certain WHY this causes the table to go berserk, but apparently that click listener on the UI is interfering with the lazy loading process of the table. I’d be grateful for any clarifications.