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!