Skip to Content

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

});

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

1 Answer

  • Jan 07, 2015 at 08:10 AM

    HI Rajeesh

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

    -D

    Add comment
    10|10000 characters needed characters exceeded