ComponentContainer与路由对话框

ComponentContainer in dialog with routing

本文关键字:对话框 路由 ComponentContainer      更新时间:2023-09-26

我有一个应用程序,我想打开一个完整的组件与sap.ui.core.ComponentContainer

<core:FragmentDefinition xmlns="sap.m" xmlns:core="sap.ui.core">
    <Dialog title="Test" class="sapUiNoContentPadding" placement="Auto" contentHeight="700px" contentWidth="700px">
        <content>
            <core:ComponentContainer name="my.other.component" />
        </content>
    </Dialog>
</core:FragmentDefinition>

对于没有路由的组件可以正常工作。如果我想给组件添加路由,对话框会自动关闭,因为它使用了主应用程序的控件

是否有办法实现这与路由启用?如果我关闭使用旧路由的对话框呢?

在sap. m.s dialog .js中有一个属性,默认值为true,在导航时关闭一个对话框。属性是closeOnNavigation。你应该把它设为false

/**
* Indicates whether the Dialog will be closed automatically when a routing navigation occurs.
* @since 1.72
*/
closeOnNavigation: {type: "boolean", group: "Behavior", defaultValue: true}

https://github.com/SAP/openui5/blob/master/src/sap.m/src/sap/m/Dialog.js

亲切的问候,nautica