Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A

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

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

});

Not what you were looking for? View more on this topic or Ask a question