cancel
Showing results for 
Search instead for 
Did you mean: 

SAP UI5 View Navigation not working

rthoodi
Active Participant
0 Kudos

Hello Experts,

My requirement is to navigate from one view(master) to another view(detail) using Web IDE, but navigation is not working, Master view is displayed with Button as expected, but when i click on it, it should go to detail view which is not working, I don't see any errors other than "Failed to load resource: the server responded with a status of 404 (Not Found)", please help, here is code.

App View:

<App id="app"/>

View1 View:

<App>

<pages> <Page title="{i18n>title}">

<content> <Button text='Next' press="handleListItemPress"></Button>

</content>

</Page>

</pages>

</App>

Detail View:

<Page title="Title" showNavButton="true" navButtonPress="handleNavButtonPress"> <content>

<Text text="This is Detail Page"/>

</content>

</Page>

Root View: App

"sap.ui5": { "rootView": { "viewName": "HelloWorld.view.App", "type": "XML" },

View1.Controller.js

return Controller.extend("HelloWorld.controller.View1", {

handleListItemPress: function(evt) { var oRouter = sap.ui.core.UIComponent.getRouterFor(this); oRouter.navTo("detail"); }

});

Accepted Solutions (1)

Accepted Solutions (1)

saurabh_vakil
Active Contributor
0 Kudos

The "detail" route in the routes array has the pattern blank (""), it should be "pattern": "detail" instead.

rthoodi
Active Participant
0 Kudos

Saurabh,

It's working with that, Thank you!

Answers (0)