导航栏的关闭功能

在使用过程中,自己在页面中又创建过一个小的cubawindow,如果使用image 中的关闭界面,导致新建的cubawindow没有办法关闭,求大佬解惑

下面这个方法能否解决你的问题?在特定的 window 被关闭之前先用代码关闭自己创建的 window。
https://doc.cuba-platform.com/manual-6.10/abstractWindow.html#abstractWindow_addBeforeCloseWithCloseButtonListener

我的问题是,如果我同时打开了A,B两个界面,A中有一个cubawindow,并且我在正常关闭A界面的时候能关闭cubawindow,但是如果我在选中Bsheet页,通过点击关闭其他界面的方式来关闭A界面会导致A界面中的cubawindow界面没法关闭。我现在需要找到上图中的右键打开关闭所有的事件在哪?

大佬,你知道上图右击打开窗体的时间在哪里吗?

右击打开窗体目前没有事件。我觉得你的能用 addBeforeCloseWithCloseButtonListener 解决吧,这个监听器可以监听所有通过 TabSheet 标签关闭的事件呀,不管是他自己关闭,还是被别的 tab 关闭其他来关闭。都在这个监听器里面。

我这边试过这种方法了,但是没有效果,被监听页面根本没有触发这个事件

看源码addBeforeCloseWithCloseButtonListener这类方法都标上@Deprecated了。试过文档里的onBeforeClose(BeforeCloseEvent event)了吗?

BeforeCloseEvent is sent right before the screen is closed by its close(CloseAction) method. The screen is still displayed and fully functional. Component settings are not saved yet. In this event listener, you can check any conditions and prevent screen closing using the preventWindowClose() method of the event,