[sapui5] [odata Model v2] use oModel.metadataLoaded().then instead of oModel.attachMetadataLoaded() to avoid unexpected error in runtime as Fiori launchpad


Hi,

The 2 below code seem to be similar:
1/ Use attachMetadataLoaded()

2/ Use private property: promise metadataLoaded()

However, they're different if you are running in Fiori launchpad, as the moment I wrote this post.
The function of the first approach (using attachMetadataLoaded()) will not be called. You need to use the second at for now. And actually, the ui5 template go with the 2nd one.

I've tried the first approach & it did trouble me a lot, so you should stick with the best practice template from SAP.


---V---

Nhận xét

Bài đăng phổ biến từ blog này

Tại sao lại chụp ảnh theo bố cục 1/3 ?

[sapui5] Best Practice in sapui5 development

Implement Search field with case-INSENSITIVE by SAP UI5