mirror of
https://gitee.com/jmix/cuba.git
synced 2024-11-30 18:27:56 +08:00
Дважды срабатывает CloseListener при програмном закрытии диалоговых окон #PL-2166 Fixed
This commit is contained in:
parent
b9f4dd8d76
commit
39793f96fa
@ -751,6 +751,7 @@ public class WebWindowManager extends WindowManager {
|
||||
getCurrentWindowData().windows.clear();
|
||||
|
||||
for (com.vaadin.ui.Window win : new ArrayList<>(AppUI.getCurrent().getWindows())) {
|
||||
removeCloseListeners(win);
|
||||
AppUI.getCurrent().removeWindow(win);
|
||||
Component currentView = AppUI.getCurrent().getContent();
|
||||
if (currentView instanceof AppWindow)
|
||||
@ -758,6 +759,13 @@ public class WebWindowManager extends WindowManager {
|
||||
}
|
||||
}
|
||||
|
||||
private void removeCloseListeners(com.vaadin.ui.Window win) {
|
||||
Collection listeners = win.getListeners(com.vaadin.ui.Window.CloseEvent.class);
|
||||
for (Object listener : listeners) {
|
||||
win.removeCloseListener((com.vaadin.ui.Window.CloseListener) listener);
|
||||
}
|
||||
}
|
||||
|
||||
private void closeWindow(Window window, WindowOpenMode openMode) {
|
||||
AppWindow appWindow = app.getAppWindow();
|
||||
|
||||
@ -771,6 +779,7 @@ public class WebWindowManager extends WindowManager {
|
||||
switch (openMode.openType) {
|
||||
case DIALOG: {
|
||||
final com.vaadin.ui.Window win = (com.vaadin.ui.Window) openMode.getData();
|
||||
removeCloseListeners(win);
|
||||
AppUI.getCurrent().removeWindow(win);
|
||||
fireListeners(window, getTabs().size() != 0);
|
||||
break;
|
||||
|
Loading…
Reference in New Issue
Block a user