I have a Master Details Page App where we configured the Router for the same to navigate between pages.
App.view.xml
<SplitApp id="rootControl" detailNavigate="onDetailNavigation">
</SplitApp>
manifest.json
"routing": {
"config": {
"routerClass": "sap.m.routing.Router",
"viewPath": "master",
"controlId": "rootControl",
"viewType": "XML",
"async":"true"
},
"routes": [
{
....
},
...
"targets": {}
...
App is simple Employee CRUD app, i have configured the router with 2 routes 1 for Create/Edit and another one for Dispaly
I need to destroy the view if i navigate from one view to another view, like on start of the page show the Master Page with all the employees and detail page show display view of the employee1.
i have Edit button on the Display view, on press i navigate details page from Display view to Edit View, on this point i need to destroy the Display view from the router, which is cached.
How to achive this? or do i need to take different approch to solve the cacheing? or I should not think of Memory
tried calling destroy onDetailNavigate of SplitApp
onDetailNavigation : function(oEvent){
console.log("Split app onDetailNavigation");
oEvent.getParameter('from').destroy();
}
Which gives Error next time go back to same view again
Error: The object with ID __xmlview4 was destroyed and cannot be used anymore.
fromview first and then destroy it? Would you get the same error if you navigate back to the same view next time? - Boghyon Hoffmannvar splitApp = this.getView().byId('rootControl'); splitApp.removeDetailPage(oEvent.getParameter('from')); oEvent.getParameter('from').destroy();still same error - chiranjeevigkvar router = this.getOwnerComponent().getRouter(); for(var view in router._oViews._oViews){ if( router._oViews._oViews[view].sId === oEvent.getParameter('fromId') ) { delete router._oViews._oViews[view]; } }- chiranjeevigk