Show notification on a different session

Hi,

I have a use case when user 1 is doing some actions the user 2 in a different session gets the notification.

On the first user’s action one event is triggered, on listening this event I am using Dialog to show the notification.

But on dialog.open() getting the error “java.lang.IllegalStateException: UI instance is not available. It means that you are calling this method out of a normal workflow where it’s always implicitly set. That may happen if you call the method from the custom thread without ‘UI::access’ or from tests without proper initialization.”

Could someone please help?

Regards,
Amal Suresh

type or paste code here

Can you please show your code? Most likely you are opening the dialog from a background thread without using UI.access, as stated in the error message.

For more info about asynchronous updates look at Server Push | Advanced Topics | Flow | Vaadin Docs

Here’s a cookbook recipe for something very similar: How do I show a notification to active users - Vaadin Cookbook

As Marco said, the likely problem is that you’re not updating the UI through ui.access