Skip to Content

Navigation or Routing between pages with in View

Hi Folks,

@Prathik Nagaraj

@Ian MacGregor

here is one scenario,

i have created one SAPUI5 project it consists only one view, view name is "pageNavigation". this view contains three pages within the view.

View Code:

<mvc:View controllerName="PageNavigation.controller.pageNavigation" xmlns:html="" xmlns:mvc="sap.ui.core.mvc"


<App id="myApp" initialPage="idMyPage1">


<Page title="My Page1" id="idMyPage1">




text="My Page2"





<Page title="My Page2" id="idMyPage2">




text="My Page3"





<Page title="My Page3" id="idMyPage3">




text="My Page1"








Controller Code:



], function(Controller) {

"use strict";

return Controller.extend("PageNavigation.controller.pageNavigation", {

onPressMyPage1: function() {

alert("My Page1");


var app = this.getView().byId("myApp");"idMyPage2");


onPressMyPage2: function() {

alert("My Page2");


// var app = sap.ui.getCore().byId("myApp");

var app = this.getView().byId("myApp");"idMyPage3");


onPressMyPage3: function() {

alert("My Page3");


var app = this.getView().byId("myApp");"idMyPage1");


onInit: function() {

var app = this.getView().byId("myApp");

var page1 = this.getView().byId("idMyPage1");

var page2 = this.getView().byId("idMyPage2");

var page3 = this.getView().byId("idMyPage3");





am not using index.html, this is directly written in controller of the View.

Can you please help me to find the gap. there is no error am getting once i execute this app.

Thank You for your help.

Best Regards,


Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

1 Answer

  • Best Answer
    Posted on Aug 22, 2016 at 12:17 PM

    Hi Kiran,

    try to call the page ids with this.createId("yourId") in your controller instead of using "yourId" directly.



    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.