on 08-11-2014 6:57 AM
HI All,
I am trying to develop a fiori like UI5 app.
I have placed the component.js file in the same folder as that of index.html
I have read the Documentation from the below sites.
below are the contents of component.js file (Zgreenfield is my App name , launchdashboard is my initial view)
-----------------------------------------------------------------
jQuery.sap.declare("ZGreenfield.greenfield_refinery.launchdashboard");
sap.ui.core.UIComponent.extend("ZGreenfield.greenfield_refinery.launchdashboard", {
createContent : function() {
// create root view
var oView = sap.ui.view({
id : "App",
viewName : "ZGreenfield.greenfield_refinery.launchdashboard",
type : "JS",
viewData : { component : this }
});
var oModel = new sap.ui.model.json.JSONModel("jsonFiles/.");
oView.setModel(oModel);
// done
return oView;
}
});
------------------------------------------------------------------
index.html
-------------------------------------------------------------------
<script
src="resources/sap-ui-core.js" type="text/javascript"
id="sap-ui-bootstrap"
data-sap-ui-theme="sap_platinum"
data-sap-ui-libs="sap.ui.commons,sap.ui.table,sap.suite.ui.commons,sap.viz"
data-sap-ui-resourceroots='{
"ZGreenfield": "./"
}' >
</script>
<script>
app: new sap.ui.core.ComponentContainer({
name : "ZGreenfield"
}).placeAt("content");
</script>
-------------------------------------------------------------------
below is the folder structure of my app
below is the error thrown in my browser console.
Please help !!
Many Thanks
Pandu
Tags edited by: Michael Appleby
Hi Pandu
The Component-preload.js file is somewhat of an undocumented feature, currently it is only supported internally or via you own build tool - see grunt-ui5 this has a Component-preload.js feature.
Essentially the component preload concatenates all the files used by the component, that is all the controllers, views, formatters etc into a single file and minifies the js, json and xml code. The idea being that 1 minified file for all you components is loaded a lot quicker than many un-minified files. Its very effective at reducing the loading of applications.
In your case you can ignore this error.
else if it really annoys you set data-sap-ui-preload="" see Preload Variant for Bootstrapping
hth
jsp
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Pandu
Looking at your console log, the second error is your issue "undefined is not a function"
Suggestion
1. run with debug source <ctrl><alt><shift> + p and chose debug sources
2. re-run app and this time expand the console error to see the full stack path - take a screenshot which has better definition and attach to question
Maybe there is an issue on one of your views.
jsp
Hi Pando,
Please take a look SAP Fiori Launchpad for Developers - Architecture Overview about component.js.
Regards, Masa
SAP Customer Experience Group - CEG
Hi Pandu
Dont worry about the first issue.
Essentially debug mode tries to load the un-minified version of all your SAPUI5 code "-dbg.js"
The second error is basically saying there is some sort of error in your JSView in the createContent method.
Create a GIST for both the jsView and Controller code for LaunchDashboardView and share the link, eg dont past code into a long running thread.
Cheers
JSP
Hi John,
component.js
https://gist.github.com/pandu536/e3d6feb49b8ec9131de8
launchdashboard.view.js
https://gist.github.com/pandu536/89001be32225b1c08638
launchdashboard.controller.js
https://gist.github.com/pandu536/282082378e394146a733
There is nothing written in the controller but i have attached that as well.
Many Thanks
Pandu
Hi Pandu
Thanks for creating the gist files, makes it a lot easier
first off some advice - you need to use JSLint with you code, launchdashboard has a lot of global variables, this will cause issues, not sure if related to error though. To fix put 'var' in front of DailyView, MonthlyView, oTab2 and newsView.
Next, if still having issues, try and comment out the how code block createContent in launchdashboard view to see if it is the issue.
jsp
Hi John,
I have edited the code in launchdashboard.view.js as suggested.
https://gist.github.com/pandu536/89001be32225b1c08638\
I am not using sap.m Libraries is that causing the problem ?
I have commented the code in create content function and tried to run th App it is still showing the same error.
Many Thanks
Pandu
You can switch the loader off by this URL-Parameter:
sap-ui-xx-componentPreload=off
Best regards, Stefan
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
86 | |
10 | |
9 | |
9 | |
9 | |
6 | |
6 | |
5 | |
3 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.