Being Able to React to Failed Service Metadata Request Sent by ODataModel Defined in App Descriptor
See original GitHub issueThis is more an enhancement request.
Motivation
Currently, the best practice is to set the ODataModel on the Component via the app descriptor (manifest.json) enabling preload
and manifest first approach.
"models": {
"myODataModel": {
"dataSource": "mainService",
"settings": {
"preliminaryContext": true
},
"preload": true
}
Since the metadata is thus requested as early as possible, attaching a "metadataFailed"
event handler in Component.js is often too late due to a race condition.
return UIComponent.extend("my.Component", {
metadata: {
manifest: "json"
},
init: function() {
UIComponent.prototype.init.apply(this, arguments);
this.getModel("myODataModel").attachMetadataFailed(/*...*/); // Too late ☹️
},
});
Luckily, there is the API isMetadataLoadingFailed
which can be leveraged to build a custom thenable method, but it would be more convenient if the framework could provide such a method out-of-the-box.
Similar request: https://github.com/SAP/openui5/issues/1399
Issue Analytics
- State:
- Created 5 years ago
- Reactions:3
- Comments:8 (8 by maintainers)
Top Results From Across the Web
Invalidate Metadata Cache For OData Services - SAP Blogs
Firstly, open the manifest. json in the WebIDE, in Descriptor Editor Format. Navigate to Data Sources and click on the Sync Metadata Button....
Read more >Odata service Metadata failed - sapui5 - Stack Overflow
I declared it in manifest and used it in controller. It works correct in my system. But it does not work correct in...
Read more >Performance: Speed Up Your App - SAPUI5 SDK
Let's have a look at the most common issues that impact performance. Enable Asynchronous Loading. The first step of improving the performance of...
Read more >SAPUI5: UI Development Toolkit for HTML5
have the same relationship in the service metadata. ... The OData model in SAPUI5 uses AJAX requests internally and the OData model ......
Read more >Working With OData in ASP.NET Core - Pluralsight
Once the EDM has been defined, we need to register it. To do so, we should call into AddOData on the services collection...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
As of SAPUI5 1.79 sap.ui.model.odata.v2.ODataModel#metadataLoaded has an optional parameter
bRejectOnFailure
. When set to true the returned promise will be rejected if the initial loading of the metadata fails. Hence closing this issue.@boghyon : Thank you for testing! I will close this issue when the functionality is shipped.
Best regards Mathias.