cancel
Showing results for 
Search instead for 
Did you mean: 

XML based Custom Fiori App

hymavathi_oruganti
Active Contributor
0 Kudos

Hello Everybody,

I am getting the following error, while trying to create XML based UI5 application.

My Component.js like below

jQuery.sap.declare("Customer.com.Component");

sap.ui.core.UIComponent.extend("Customer.com.Component", {

metadata : {

   manifest: "json"

},

createContent : function() {

        // create root view

       var oView = sap.ui.view({

      

            id: "idRoot",

            viewName: "Customer.com.view.Root",

            type: "XML",

            viewData: { component : this }

        });

return oview;

}

});

manifest.json  like below:

{

  "_version": "1.1.0",

  "sap.app": {

  "_version": "1.1.0",

  "id": "Customer.com",

  "type": "application",

  "title": "Customer Info",

  "description": "A simple walkthrough app that explains the most important concepts of OpenUI5",

  "applicationVersion": {

   "version": "1.0.0"

  },

  "ach": "CA-UI5-DOC"

  },

  "sap.ui": {

  "_version": "1.1.0",

  "technology": "UI5",

  "deviceTypes": {

   "desktop": true,

   "tablet": true,

   "phone": true

  },

  "supportedThemes": [

   "sap_bluecrystal"

  ]

  },

  "sap.ui5": {

  "_version": "1.1.0",

  "rootView": "Customer.com.view.Root",

  "dependencies": {

   "minUI5Version": "1.30",

   "libs": {

  "sap.m": {}

   }

  }

  }

}

Root.view.xml

<core:View

  controllerName="Customer.com.view.Master"

  xmlns:m="sap.m"

  xmlns:core="sap.ui.core"

  xmlns:mvc="sap.ui.core.mvc" >

  <SplitApp id="idRoot">

        <masterPages>

            <mvc:XMLView viewName="Customer.com.view.Master" id="idMaster" />

        </masterPages>

        <detailPages>

            <mvc:XMLView viewName="Customer.com.view.Detail" id="idDetail" />

        </detailPages>

    </SplitApp>

</core:View>

Index.html like below:

<html>

  <head>

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

  <meta charset="UTF-8">

  <title>My Fiori 10</title>

  <script

  id="sap-ui-bootstrap"

  src="/resources/sap-ui-core.js"

  data-sap-ui-theme="sap_bluecrystal"

  data-sap-ui-libs="sap.m, sap.ui.layout"

  data-sap-ui-xx-bindingSyntax="complex"

  data-sap-ui-resourceroots='{

  "Customer.com": "./"

  }' >

  </script>

  <script>

  sap.ui.localResources("view");

  new sap.m.Shell({

  app : new sap.ui.core.ComponentContainer({

  name : "Customer.com"

  })

  }).placeAt("content");

  </script>

  </head>

  <body class="sapUiBody" id="content">

  </body>

Please guide me where i am doing wrong.

Thanks and Regards,

Hyma

Accepted Solutions (1)

Accepted Solutions (1)

saurabh_vakil
Active Contributor
0 Kudos

I can point out 2 things here:

1. In the Component.js you are declaring the variable oView (camelcase with a capitalized V) whereas in the return statement of createContent() you are returning oview (with a smallcase v) - please correct this.

2. In your Root.view.xml you have defined an alias m for the sap.m namespace (xmlns:m="sap.m"), you will therefore have to reference to all occurrences of SplitApp as <m:SplitApp>...</m:SplitApp> instead of <SplitApp>...</SplitApp>

hymavathi_oruganti
Active Contributor
0 Kudos

Thanks a lot. Thats a good catch.

But now i am getting new error.  can you or any help on this please .

Thanks and Regards,

Hyma

saurabh_vakil
Active Contributor
0 Kudos

In the index.html file just replace the reference to the sap-ui-core.js file in the Bootstrap script with the CDN path as below and try to run the app:

replace

src="/resources/sap-ui-core.js"


with


src="https://sapui5.hana.ondemand.com/resources/sap-ui-core.js"
hymavathi_oruganti
Active Contributor
0 Kudos

Hi All,

The above error resolved .

I have changed the src library to "https://sapui5.hana.ondemand.com/resources/sap-ui-core.js".

Problem solved.

Thanks vakil for your help.

Thanks and Regards,

Hyma

Answers (0)