single UI per session

Vaadin 7 creates new UI for requests comming from new browser windows/tabs. I have two questions regarding this:

  1. How does Vaadin knows that I opened new tab? Session Id is the same as in the first tab, is seccond tab diferent and how? How does Vaadin makes distinction?

  2. If i wanted to show the same UI in the new tav/window, how can it be implemented? It worked like that in Vaadin 6. Basically, I want single UI per session. Something like “@PreserveOnRefresh”, this would be “@PreserveOnNewWindow”.

Thanks!

Hi,

indeed that was the way it worked on Vaadin 6. And that ended up in “out of sync” errors if you opened the same application in two tabs and interacted with both. As fas as I know this is not possible out-of-the-box in vaadin 7. However, you could possibly achieve something like this by writing your own UIProvider. See an example at
https://vaadin.com/book/vaadin7/-/page/mobile.features.html
. Basically what you need to do is override the createInstance method and always provide the same UI instance (and of course instantiate one on the first call). Since each session will get its own UIProvider, this should result in one UI instance per session.

Disclaimer: I haven’t tried this out and don’t know if it will work.

-tepi

Thanks, understood.