I have two views: Login and Menu.
Scenario:
Log in -->
onInit() , onBeforeRendering() , onAfterRendering()
gets called in Menu.controller.js and go to the Menu view.Log out -->
deleteData(); oRouter.navTo("Login", {}, true);
Back to the login view.Log in -->
onInit() , onBeforeRendering() , onAfterRendering()
doesn't get called and go to the Menu view.
I've tried to attach my Menu controller to a specific route in onInit but it doesn't work:
function onInit(){
this._oRouter = sap.ui.core.UIComponent.getRouterFor(this);
this._oRouter.attachRouteMatched(initMenu, this);
this.initMenu();
}
How to forcefully call the above methods again? I need to reload the method initMenu()
which is in the onInit() function to receive the menu correctly.