我有一个小测试应用程序(刚入门),我想根据我所在的应用程序的哪个区域更改工具栏。此刻,我正在使用工具栏控件。当目标将视图实例化到工具栏中时,多个工具栏同时可见。在OpenUI5中,我如何获得加载新工具栏的目标,但是擦除了现有的工具栏?
我已经看到“clearAggregation”:true应该确保只有一个工具栏,但是我的目标设置中的配置项没有被遵守。
我认为某些容器因为其预期用途而不遵守“ClearAggregation”,所以我的问题是我应该使用哪个容器,以便通过路由和导航系统填充区域?
具体目标:
"signedout-toolbar": {
"viewName": "SignedOutToolbar",
"controlId": "__component0---appframe--main-toolbar",
"controlAggregation": "content",
"clearAggregation": true
},
"standard-toolbar": {
"viewName": "StandardToolbar",
"controlId": "__component0---appframe--main-toolbar",
"controlAggregation": "content",
"clearAggregation": true
},
根视图:
<mvc:View
controllerName="cpanel.controller.App"
xmlns:mvc="sap.ui.core.mvc"
xmlns:xhtml="http://www.w3.org/1999/xhtml"
displayBlock="true"
xmlns="sap.m">
<ToolBar id="main-toolbar" />
<App id="app" />
</mvc:View>