How can I remove a master or detail page from SplitApp?

左心房为你撑大大i 提交于 2019-12-25 03:24:53

问题


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"
));

I have this error:

2014-09-05 17:12:01 adding element with duplicate id 'clientiListMaster' -

What is the problem...?


回答1:


This part:

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

is instantiating a view and giving it the id clientiListMaster.

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.



来源:https://stackoverflow.com/questions/25689127/how-can-i-remove-a-master-or-detail-page-from-splitapp

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!