on 08-29-2014 4:39 PM
Hi all,
I've had some UI5 experience over the last months developing Java EE applications with UI5 javascript frontend, deployed to HCP.
Now I'd like to learn the HTML5 side of HCP, in order to develop UI5 applications, leveraging also RDE.
However, with RDE/HTML5, I'm really unable to load a very easy application ("hello world") which shows a simple textview controller in the main Javascript view.
I can see that the RDE wizard creates a XML view, which I deleted and changed the UI5 application to be fully javascript oriented with a JS view.
Of course I also edited the index.html accordingly.
Whatever I do, I get a weird javascript error:
The Chrome debugger doesn't even get into the view code itself, the error is at framework level.
I am starting to wonder whether there's any requirement/limitation on how the HTML5 applications should be arranged (e.g. only UI5 XML views are supported).
Could anyone please shed some light?
Thanks a lot
Regards
Vincenzo
Tags edited by: Michael Appleby
Hi Vincenzo,
Based on the error message it looks like your JSview is not loaded properly. here is example..
<script>
sap.ui.localResources("treetable");
var view = sap.ui.view({id:"idtabletree1", viewName:"treetable.tabletree", type:sap.ui.core.mvc.ViewType.JS});
view.placeAt("content");
</script>
Regards,
Shankar
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Shankar,
thanks for your reply
My code in index.html seems ok as it is actually like
<script>
sap.ui.localResources("view");
var view = sap.ui.view({id:"jsview", viewName:"view.jsview", type:sap.ui.core.mvc.ViewType.JS});
view.placeAt("content");
</script>
The folder structure is:
the ui5 destinations seem ok in the neo-app.json
Still I get the error above.
Are you sure that js views are supported?
Thanks a lot, regards
Vincenzo
Hi Vincenzo,
I just tested it myself and actually did not have any issue.
Not sure which template you used. I started with the empty SAPUI5 mobile app. Then created a new file naming it jsview.view.js and added some coding there:
sap.ui.jsview("view.jsview", {
getControllerName : function() {
return "view.jsview";
},
createContent : function(oController) {
return new sap.m.Page({
title: "Title",
content: [
]
});
}
});
And changed the view type from sap.ui.core.mvc.ViewType.XML to sap.ui.core.mvc.ViewType.js in the index.hmtl
<script>
sap.ui.localResources("view");
var app = new sap.m.App({initialPage:"jsview"});
var page = sap.ui.view({id:"jsview", viewName:"view.jsview", type:sap.ui.core.mvc.ViewType.JS});
app.addPage(page);
app.placeAt("content");
</script>
All worked fine ...
Regards, Margot
User | Count |
---|---|
86 | |
10 | |
10 | |
9 | |
7 | |
7 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.