Skip to Content

SAP UI5 View Navigation not working

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"); }

});

capture.png (28.3 kB)
Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

1 Answer

  • Best Answer
    Jul 20, 2017 at 04:44 PM

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

    Add comment
    10|10000 characters needed characters exceeded