cancel
Showing results for 
Search instead for 
Did you mean: 

Is it possible to dynamically set first page of sapui5 app?how?

Former Member
0 Kudos

Hi,

My requirement is first i need to load login page.when the user is not logged out next time when he login he should get dashboard page.if logged out he should see login page?experts plz help

app.view.js is below..

sap.ui.jsview("com.opensap.App", {

  getControllerName: function() {

  return "com.opensap.App";

  },

  createContent : function(oController) {

  // Main app container we app pages to, can control the flow of application

  this.app = new sap.m.App();

  // Pre-load all the views, this can also be achieved with lazy loading when the page is required

  // by checking for the existence of the page instance.

  var ProductDetailPage = sap.ui.jsview("ProductDetail","com.opensap.ProductDetail");

  ProductDetailPage.app = this.app;

  this.app.addPage(ProductDetailPage);//this is login page

  var DashboardPage = sap.ui.jsview("Dashboard","com.opensap.Dashboard");

  // Make the app instance available to each view for easy access by the controller

  DashboardPage.app = this.app;

  this.app.addPage(DashboardPage);

  var ProductListPage = sap.ui.jsview("ProductList","com.opensap.ProductList");

  // Make the app instance available to each view for easy access by the controller

  ProductListPage.app = this.app;

  this.app.addPage(ProductListPage);

  return this.app;

  } // end createContent

});

Accepted Solutions (0)

Answers (1)

Answers (1)

former_member182862
Active Contributor
0 Kudos

HI Rajeesh

In this example, see the second line, I set the initial page to page2.

-D