cancel
Showing results for 
Search instead for 
Did you mean: 

Navigation with navTo function when project namespace is provided

Former Member
0 Kudos

Hi,

We are having Master-Detail Application wherein we want navigation from one page to another.


Currently there are two pages, master and detail. A new page has been created, let’s say ‘About’. Navigation has to be done from Detail page to About page.

To navigate, one button is there on Detail page, to which action has been assigned to open About page.

For navigation, we are using function “navTo”. But if application has been created with project namespace then “navTo” is not working somehow. Whereas, if “myNavToWithoutHash” function is used to navigate there, then it is working fine.

Giving example of one application – “BPXFioriMDNamespace”.

There are mainly 3 pages – Master.page, Detail.page and About.page.

Two actions – OpenAbout and OpenAbout_myNavToWithoutHash (Former action is using navTo and later is using myNavToWithoutHash function to navigate)

And two buttons on Detail.page – NavTo and NavToWithoutHash. OpenAbout action has been assigned to NavTo and the other action has been to NavToWithoutHash.


You can find navigation related code inside Detail.controller.js file. (126 to 134 lines)


Detail.view.xml file code:


index.html file code:


Could anyone please help us to know how to navigate with navTo function when projectNamespace is provided?


Thanks & Regards,

Rhythm Sharma

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi Sharma,

In your application, press Ctrl+Alt+Shift+P, tick on Use Debug Sources and reload the application. Now open your browser Console and observe the message shown when you clicked on NavTo button.

Is the route existed? Is the route pattern matched? Any other error?

Hope it helps. Cheers!

Former Member
0 Kudos

Thanks Nguyen, for the quick response!

I enabled the Debug Sources check-box and saw the console for both buttons.

For navTo function, it is coming as -

[index.html] The route named 'About' did match with its pattern - EventProvider sap.ui.core.routing.Route

The console when I clicked on button - 'NavTo' looks like -

And console for the button - 'NavToWithoutHash' -

It says, pattern matched but the difference I could see is in firing the events when button is clicked!

Did I get it right?

Regards,

Rhythm