【发布时间】:2019-09-07 00:03:45
【问题描述】:
我有一个 SAPUI5 应用程序,它使用 sap.ui.core.ComponentContainer 在其内部加载其他应用程序。类似于 fiori 启动板的东西。但令人惊讶的是,当我从页面中删除组件容器并稍后尝试重新加载它时,它将被添加到 HTML 页面中但不会显示。
var oPage = this.getView().byId("page");
oPage.removeAllContent();
if(!this._aComps[sObjectId]){
this._aComps[sObjectId] = new sap.ui.core.ComponentContainer({ name: sObjectName});
}
oPage.addContent(this._aComps[sObjectId]);
知道它只在初始化时显示的原因是什么吗?
虽然此代码始终有效:
var oPage = this.getView().byId("page");
oPage.removeContent();
oPage.addContent(new sap.ui.core.ComponentContainer({ name: sObjectName}));
【问题讨论】:
标签: sapui5