Vaadin Session

Hello!

I have got a strange kind of problem.

Having a Vaadin App (16.0.0.rc1, also 15.0.6) and opening the app in 3 browser tabs. Now I am excecuting following code in the first tab by pressing a button in my ui.

for (final com.vaadin.flow.component.UI cu : com.vaadin.flow.component.UI.getCurrent().getSession().getUIs()) {
	// Vaadin reports 3 instances of UI (my 3 tabs).
	
	// And now I am doing this
	cu.getPage().executeJs("window.location.replace('http://www.google.de')"); 
}

The Javascript-code is executed in the first tab (the one I pressed the button in).

The other 2 tabs do not receive any Javascript-code.

Why Vaadin reports 3 Instances (I think this should be right) and why I can not send some Javascript-code to the both other tabs?

What I have got to do to solve this?

Thank you very much,
Thomas

Without any additional changes, a browser tab can only receive updates from a UI during a request-response cycle. You’ll need Push (and a way to deal with UI locking) to send asynchronous updates. I’d recommend you start from here: https://vaadin.com/docs/v14/flow/advanced/tutorial-push-broadcaster.html and follow the links to learn about Push. There’s also a Push training (for V14, but should be applicable for later versions too) which you may find helpful: https://vaadin.com/learn/training/v14-push