on 01-08-2014 7:17 AM
Hi all,
I'm trying to deploy a simple application in SAP HANA cloud local runtime. The application displays a simple form. I have the createContent method in view.js file.
But when I run the application in the Local runtime, I get the following error.
Uncaught TypeError: Object [object Object] has no method 'createContent' sap-ui-core.js:126
What could be the reason for this error? Please suggest me how I should proceed.
Regards,
Saranya
Hi Saranya,
You might give wrong name in sap.ui.jsview....
You have to give name as below..
"sap.ui.jsview("packagename.viewfilename", { ................................... "
Check the above one clearly...
Regards,
Surendra.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Surendra,
sap.ui.localResources("simpleform");
var view = sap.ui.view({id:"idpage11", viewName:"simpleform.page1", type:sap.ui.core.mvc.ViewType.JS});
view.placeAt("content");
This is the code inside <script> in my index.html. The package name is simpleform and view file name is page1.view.js. Should I change it?
Thanks,
Saranya
Hi Saranya,
I try the scenario myself and it can run well. Here is the detail information:
Project structure:
index.html
<!DOCTYPE HTML>
<html>
<head>
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<script src="resources/sap-ui-core.js"
id="sap-ui-bootstrap"
data-sap-ui-libs="sap.ui.commons"
data-sap-ui-theme="sap_goldreflection">
</script>
<!-- add sap.ui.table,sap.ui.ux3 and/or other libraries to 'data-sap-ui-libs' if required -->
<script>
sap.ui.localResources("simpleform");
var view = sap.ui.view({id:"idpage11", viewName:"simpleform.page1", type:sap.ui.core.mvc.ViewType.JS});
view.placeAt("content");
</script>
</head>
<body class="sapUiBody" role="application">
<div id="content"></div>
</body>
</html>
js file
sap.ui.jsview("simpleform.page1", {
/** Specifies the Controller belonging to this View.
* In the case that it is not implemented, or that "null" is returned, this View does not have a Controller.
* @memberOf simpleform.page1
*/
getControllerName : function() {
return "simpleform.page1";
},
/** Is initially called once after the Controller has been instantiated. It is the place where the UI is constructed.
* Since the Controller is given to this method, its event handlers can be attached right away.
* @memberOf simpleform.page1
*/
createContent : function(oController) {
alert("Hello world!");
}
});
This can run successfully in both nwds and ie.
You can copy the url here to run it in IE(Keep the original tab open while running it in IE)
Hope this can give some help.
Best regards,
Aria
User | Count |
---|---|
86 | |
10 | |
10 | |
9 | |
6 | |
6 | |
6 | |
5 | |
4 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.