cancel
Showing results for 
Search instead for 
Did you mean: 

Override of onBeforeNavigation in Object Page Controller extension is not called

MattDion
Participant
0 Kudos
842

Hello,

I have the requirement to override the navigation from a responsive table on an Object Page in an OData V4 app. I have followed the instructions here:

https://sapui5.hana.ondemand.com/sdk/#/topic/b20dc7a3d9ca41bebdb86fc3ae3295bf

My problem is that the onBeforeNavigation override method is never called, and it just proceeds with the default navigation settings.

I have overridden the onInit and onBeforeRendering methods in the same controller extension, and these work fine. Also in the same app, I have a List Report controller extension with the routing/onBeforeNavigation method overridden, and this works fine.

Are the instructions incorrect/incomplete for the Object Page table? Is there a trick here that I am missing?

 

ControllerExtension.extend("sap.fe.templates.ObjectPage.ObjectPageController", {
        override: {
            routing: {
                onBeforeNavigation: function(oContextInfo) {
                    console.log(oContextInfo);
                    return true;
                }
            }

 

 

View Entire Topic
MattDion
Participant
0 Kudos

For intent based navigation, you need to override a different method:

override: {
    intentBasedNavigation: {
        adaptNavigationContext: function(oContextInfo) {
        }
    }
}

 

RaminS
Active Participant
0 Kudos
How do you do this in v2?