cancel
Showing results for 
Search instead for 
Did you mean: 

Master-Detail Navigation Behavior Problem

rauf_shaikh
Active Participant
0 Kudos

Hello,

I am having problem in navigating from Master to Detail.


Scenaio:

Master1 ---> Master2 ---> Detail

Problem and Requirement

I navigate to Master2 from Master1 properly.

When I click list item of Master2 and navigate to Detail, my master page automatically navigates to Master1.

There is no error or such. Detail page gets loaded perfectly but navigation from Master2 ---> Master1 is not required which is happening automatically.

I am using this.oRouter.navTo() method.

Any idea how to deal with this?

Kind regards,

Rauf

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

can you show how you've defined the routes ?

rauf_shaikh
Active Participant
0 Kudos

Hi Sakthivel,

Thanks for showing interest in my problem.

See routes:


masterPageRoutes:{

        "master":{

        pattern:"",

        view:"master"

        },

        "subMaster":{

        pattern:"subMaster",

        view:"master2"

        },

        "volumeMaster":{

        pattern:"subVolumeMaster",

        view:"volumeMaster"

        },

        "amortizationView":{

        pattern:"subamortizationView",

        view:"amortizationView"

        }

    

        },

  detailPageRoutes:{

  "empty":{

  pattern:"",

  view:"empty"

  },

  "detail":{

  pattern:"detail",

  view:"detail"

  },

  "subDetail":{

  pattern:"subDetail",

  view:"detail"

  }

        },

and I am calling detail page like following:


this.oRouter.navTo("subDetail",{

  });

Regards,

Rauf

Former Member
0 Kudos

Using scaffolding ? if yes, check the documentation which says scaffolding supports only one master view per app.

JsDoc Report - SAP UI development Toolkit for HTML5 - API Reference - sap.ca.scfld.md.ComponentBase

rauf_shaikh
Active Participant
0 Kudos

Hi Sakthivel,

We solved it . And you guessed right, using scaffolding and it was related to routes only.
Modified routes as follows:


masterPageRoutes:{

        "master":{

        pattern:"",

        view:"master",

            subroutes: [

    {

    pattern: "master/{contextPath}/detail",

    name: "detail3",

    view: "detail"

    }

    ]

        },

        "master2" : {

        pattern : "master2/{contextPath}",

        view : "master2",

        subroutes: [

  {

  pattern: "master2/{contextPath}/detail",

  name: "detail2",

  view: "detail"

  }

  ]

        }

        },

Referred DEMO APP and following URL:
SAPUI5 SDK - Demo Kit

Thanks for your kind attention to my problem. Keep it up

Regards,

Rauf

marcin_czarny_nype
Participant
0 Kudos

Hello, I have a similar problem.

Can you show the code responsible for navTo? Because I assume that this


this.oRouter.navTo("subDetail",{ 

});

is not correct because I can't see contextPath anywhere. Can You help me?

Former Member
0 Kudos

Well, you have to add the data you want to display as contextPath:

this.oRouter.navTo("subDetail", { contextPath : "yourValue" });