cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Uncaught TypeError: sap.ui.ComponentContainer is not a constructor

sknagoorsharief
Explorer
0 Kudos
1,105

Hi Experts !!

Please Please Please Help Me :((((

<!DOCTYPE html>

<html>

<head>

<meta charset="utf-8">

<title>SAPUI5 Walkthrough</title>

<script id="sap-ui-bootstrap"

src="https://openui5.hana.ondemand.com/resources/sap-ui-core.js"

data-sap-ui-theme="sap_bluecrystal"

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

data-sap-ui-compatVersion="edge"

data-sap-ui-resourceroots='{ "mario": "./" }'>

</script>

<script>

var oView = new sap.ui.ComponentContainer({

name: "mario.view.Main",

type: "sap.ui.core.mvc.ViewType.XML"

});

oView.placeAt("content");

</script>

</head>

<body> <div id="content"></div>

</body>

</html>

<mvc:View xmlns:core="sap.ui.core" xmlns:mvc="sap.ui.core.mvc" xmlns="sap.m"

xmlns:f="sap.ui.layout.form"

controllerName="mario.controller.Main"

xmlns:html="http://www.w3.org/1999/xhtml">

<App>

<pages>

<Page title="Main View"> <content> <f:SimpleForm> <f:Title> <core:Title text="Personal Details"></core:Title> <f:content> <label text="First Name" width="50%" id="label0"></label> <input value="Sharief" width="50%" id="input0"></input> <label text="Last Name" width="50%" id="label1"></label> <input value="shaik" width="50%" id="input0"></input> <label text="Salary" width="50%" id="label2"></label> <input value="90000" width="50%" id="input0"></input> <label text="Currency" width="50%" id="label3"></label> <input value="ERO" width="50%" id="input0"></input> </f:content> </f:Title> </f:SimpleForm> </content> </Page>

</pages>

</App>

</mvc:View>

sap.ui.define([ "sap/ui/core/mvc/Controller", ], function (Controller) { "use strict"; return Controller.extend("mario.controller.Main", { onInit: function () { var oModel = new sap.ui.model.xml.json.JSONModel(); oModel.setData( { "EmpStr": { "EmpNo": 1000, "EmpName": "Sharief", "Salary": 9000, "currency": "INR" }, "EmpTab": [{ "EmpNo": 1002, "EmpName": "Sharmila", "Salary": 92000, "Currency": "ERO" }, { "EmpNo": 1003, "EmpName": "rehan", "Salary": 92000, "Currency": "INR" }, { "EmpNo": 1004, "EmpName": "Aslam", "Salary": 92000, "Currency": "ERO" }, { "EmpNo": 1004, "EmpName": "Loksh", "Salary": 92000, "Currency": "INR" }] }); sap.ui.getCore().setModel(oModel); }, }); });

Accepted Solutions (0)

Answers (1)

Answers (1)

joltdx
Active Contributor
0 Kudos

Hi!

Is it the sap.ui.core.ComponentContainer you're looking for? See the SAPUI5 API reference for it here. However, there's no type attribute for that one.

Also see the SAPUI5 documentation for 'Using and Nesting Components'

sknagoorsharief
Explorer
0 Kudos

when ever i removed "new" keyword it showing me an error As "

Uncaught TypeError: sap.ui.ComponentContainer is not a function at extended_runnable_file.html?hc_orionpath=%2FDI_webide_di_workspacecyvivgxwtvqfr4gd%2FzSapProjectNew≠o-di-affinity=BIGipServerdisapwebide.eu2.hana.ondemand.com+!6ShOf10KHzEcJVKJkgGcuDQcAbtZRxUMeeznNN%2FYTDwkvz3veuvg1lHWDj1gNAg4Dwzd0CYsAKwdK44%3D∨igional-url=index.html&sap-ui-appCacheBuster=&sap-ui-xx-componentPreload=off:14

joltdx
Active Contributor
0 Kudos

sap.ui.core.ComponentContainer