如何从 SplitApp 中删除主页或详细信息页面? [英] How can I remove a master or detail page from SplitApp?

查看:29
本文介绍了如何从 SplitApp 中删除主页或详细信息页面?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我通过以下方式添加母版页:

I add a master page by:

splitApp.addMasterPage(sap.ui.xmlview(
  "clientiListMaster",
  "apps.appClienti.master.clientiListMaster"
));

好的.我的应用完美运行!

Ok. my app work perfectly!

现在我想从拆分的应用程序中删除它..我尝试这样做:

Now I want remove it from split app.. i try to do it by:

splitApp.removeMasterPage("clientiListMaster");

但在那之后,如果我尝试再次添加同一页面:

but after that, if I try to add once again the same page by:

splitApp.addMasterPage(sap.ui.xmlview(
  "clientiListMaster",
  "apps.appClienti.master.clientiListMaster"
));

我有这个错误:

2014-09-05 17:12:01 添加具有重复 ID 'clientiListMaster' 的元素 -

有什么问题...?

推荐答案

这部分:

sap.ui.xmlview("clientiListMaster", "apps.appClienti.master.clientiListMaster")

正在实例化一个视图并赋予它 id clientiListMaster.

is instantiating a view and giving it the id clientiListMaster.

你做了两次,这就是 UI5 所抱怨的.实例化一次并存储对它的引用(例如在控制器中),然后在每次添加时使用该引用(对单个实例).

You're doing it twice, which is what UI5 is complaining about. Instantiate it once and store a reference to it (e.g. in the controller) and then use that reference (to the single instance) when adding each time.

这篇关于如何从 SplitApp 中删除主页或详细信息页面?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆