问题
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