Important Notice - Forums is archived
To simplify things and help our users to be more productive, we have archived the current forum and focus our efforts on helping developers on Stack Overflow. You can post new questions on Stack Overflow or join our Discord channel.

Vaadin lets you build secure, UX-first PWAs entirely in Java.
Free ebook & tutorial.
Vaadin View removes JavaScript Component from DOM
I have a Vaadin 7 application with a single UI and a few views hooked in by a spring-based provider. In one of the views we have a javascript-based map (not a Vaadin component yet) that we add to the view using a Label (as the map's DOM parent). The map and other Vaadin components are initialised in View.init() and all goes well until we switch away from the map view and back into it. The map (DOM elements) are removed from the parent label, and the map is, thus, gone. The other components within the same view work all right.
I'm trying to understand and fix this issue. I hoped something like @PreserveOnRefresh would do some sort of magic, but it doesn't. Is there something else I'm missing? Note that the map is quite complex and keep its own state, so to speak. We cannot initialise it every time (e.g. upon view.enter()), as it is a costly operation. Why does the map get removed? Must I use an AbstractJavaScriptComponent?
Thanks in advance!