Hi everyone,
so i have this problem with Windows that sort of pile up. Let me explain better: i have an application with the same exact navigation structure as the dashboard shown on this site, and i use a guava eventbus to send event.
So what happens is this: i have a button in one page that does a procedure, and if it completes correctly it fires up an event. I also have a method registered to that event that show my window (that extends the regular window class). The window i show is a private class member, and i show it like this:
if (window == null) {
window = new VatFoundClientiWindow("Partita iva individuata", vatFoundEvent.getFoundVat());
} else {
UI.getCurrent().removeWindow(window);
window = new VatFoundClientiWindow("Partita iva individuata", vatFoundEvent.getFoundVat());
}
Now, i have 3-4 views that uses this paradigm, BUT they use different events. What happens is this:
1 - I open the window on page A;
2 - I open the window on page B (after navigating there);
3 - I go again to page A and open a window, BUT this time two show instead of one;
4- I go to B again, same procedure, three windows.
And so on. That’s why i say that they are piling up, it looks like they remain orphan and get shown.
How could i solve this?
Thanks a lot!