Application Event Problem

Hi everyone,
I have 2 users, A and B.
I use UiEventPublisher to send an event to user B. When user B receives the event, I assign a value to an attribute in sessiondata.
Looking at the log, I see that user B received the event. I wrote the onBeforeShow event in MainView to get the value in sessiondata, but for some reason, the value I set in the event handler for user B is set in user A’s session data.
I am running the debug in the IDE and using two different browsers to log in to each user. Is there something wrong here? Can someone help me with this case?
I am using version 2.2 of Jmix.
Thanks!

Hi

publishEventForUsers() is not truly achieves other user session contexts but does sort of emulation of that. So you can either assign your data to view instance or obtain recevier’s user session with VaadinSession.getCurrent() method in context of the event handler

2 Likes

I have resolved my problem. Thank you very much for this very helpful suggestion.