javavaadin7

Closing a Window with resource displayed in a BrowserFrame component causes a second request


I have a runtime generated pdf that I display in a BrowserFrame in a Window. After the window is closed, the resource is requested again (why?), which causes an error on server side, because the connector was already unregistred. How can I make the Window not request the resource again?

You can reproduce the duplicated request easily with the code

Window window = new Window("", new BrowserFrame("", new StreamResource(() -> new ByteArrayInputStream(new byte[]{}), "hehe.pdf")));
UI.getCurrent().addWindow(window);

Java 8, Vaadin 7.7.11


Solution

  • There is a document case with a workaround in Vaadin's issue tracker

    https://github.com/vaadin/framework/issues/11369#issuecomment-449370057

    Upgrade to Vaadin 7.7.16 should have a fix

    https://github.com/vaadin/framework/pull/11402