on 03-24-2015 3:13 PM
Hello,
I'm trying to optimize the startup time of my app, and (app)CacheBuster solves most of the problems, but I'm still unhappy with the metadata load which I can't seem to make asynchronous.
In component.js I'm calling this:
this.setModel(new sap.ui.model.odata.ODataModel(sServiceUrl, true, null, null, null, false, true).attachMetadataLoaded(this, this._onMetaLoad));
But I'm getting this timeline in Chrome:
The List.view.xml is the first view loaded by the component according to the router, but it seems to wait until the metadata load is finished before it is retrieved. The last "true" in the model creation should be setting it to asynchronous, and if I break point the code, the next instruction does run before the metadata is returned.
It seems to be asynchronous but apparently it is blocking the loading of the next element. Which is even stranger since the oData service is connection to an ECC while the SAPUI5 is running in a local web server.
Any ideas?
Thanks
you mised one more parameter
var ODataModel = Model.extend("sap.ui.model.odata.ODataModel", /** @lends sap.ui.model.odata.ODataModel.prototype */ {
-? (sServiceUrl, true, null, null, null, false, true ???????? )
constructor : function(sServiceUrl, bJSON, sUser, sPassword, mHeaders, bTokenHandling, bWithCredentials, bLoadMetadataAsync) {
that's why we use json settings
sServiceUrl, {
...
loadMetadataAsync : true,
....
}
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
It goes half way. You put one parameter outside the brackets and then named ones inside the brackets.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello Joao,
What version of SAPUI5 are you using ?
The API doc here : JsDoc Report - SAP UI development Toolkit for HTML5 - API Reference - sap.ui.model.odata.ODataModel , the 8th parameter that you send while instantiating the oData Model determines whether the metadat call is sync/async.
{object} | bLoadMetadataAsync? | (optional) determined if the service metadata request is sent synchronous or asynchronous. Default is false. Please note that if this is set to true attach to the metadataLoaded event to get notified when the metadata has been loaded before accessing the service metadata. |
By default the metedata is loaded sysnchronously. Please pass the highlited parameter and check.
this.setModel(new sap.ui.model.odata.ODataModel(sServiceUrl, true, null, null, null, false,true, true).attachMetadataLoaded(this, this._onMetaLoad));
Best Regards,
Radhika
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
84 | |
10 | |
10 | |
10 | |
7 | |
6 | |
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.