cancel
Showing results for 
Search instead for 
Did you mean: 

TypeError: sap.ui.app is undefined

Srisap
Participant
0 Kudos

Based on the blog post Developing a simple List based SAPUI5 Application I am trying to create the exact same application. But I am facing the below error and the application fails to load.

All help appreciated.

Accepted Solutions (0)

Answers (3)

Answers (3)

0 Kudos

Hi Sridhar,

Were you able to resolve this issue? If yes, could you please help me with the same as i am facing the same issue. TIA.

Regards,

Sumit Jindal

Former Member
0 Kudos

Hi Sridhar,

sap.ui.app is not a library..plese include this sap.ui.commons replacing sap.ui.app..I hope this will solve your issue..

Thanks and regards,

Ashish Kumar

dennis_terhoeven
Explorer
0 Kudos

Hi Ashish,

adding jQuery.sap.require("sap.ui.app.Application"); to my Application.js helped.

Application.js


jQuery.sap.declare("Application");

jQuery.sap.require("sap.ui.app.Application");

sap.ui.localResources("util");

sap.ui.app.Application.extend("Application", {

    init : function() {

  jQuery.sap.require("util.Utility");

  jQuery.sap.require("util.Formatter");

  jQuery.sap.require("util.Connectivity");

  jQuery.sap.require("util.BusyDialogHandler");

     //Call the method that created the model - login dialog will popup as no credantial where given

  createModel();

    },

    main : function() {

  loadTheme("sap_bluecrystal");

  sap.ui.localResources("app");

    var root = this.getRoot();

    sap.ui.jsview("app.App", "app.App").placeAt(root);

  }

});

Regards,

Dennis Terhoeven

Former Member
0 Kudos

Dear all,

I had the same problem and the tip from Dennis worked like a charm.

Thank you Dennis!

Regards, Petra

Former Member
0 Kudos

Looks like core SAPUI5 js libraries were not loaded i.e bootstrapping of sapui5.core.js could be missing.

Please check index.html and see  if core js libraries for SAPUI5 did get loaded first. Pls share that too. I see lot of files not found which should be checked first as some core js files for sapui5 first get loaded then your app starts i.e bootstrapping step should be successful.

thanks
A

Srisap
Participant
0 Kudos

The application was created by the Wizard.

Here you go the index.html...


<meta http-equiv="X-UA-Compatible" content="IE=edge">

<meta http-equiv='Content-Type' content='text/html;charset=UTF-8' />

<link rel="stylesheet" href="app/css/MobileStyles.css">

<!-- src Location of SAP UI5 libraries need to be changed to refer to right location -->

<script src="resources/sap-ui-core.js" id="sap-ui-bootstrap"

  type="text/javascript" data-sap-ui-libs="sap.m, sap.ui.app">

  </script>

<script>

I checked rechecked, but I am not able to understand why Application.js is in error.