本文介绍了SmartTable 控件自 1.74 起有内部加载资源错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在某些 SAP Cloud Foundry UI5 应用中使用了SmartTable"控件.

一周左右后,由于以下 XHR 加载失败,表格控件无法再使用当前版本 (1.74.1) 呈现:

https://sapui5.hana.ondemand.com/resources/sap/ui/table/TableExtension.js

如果我强制使用旧版本 - 例如1.73.1" - 那么它可以正常工作并且找到上述资源.

我不知道智能表"概念有什么改变,还是图书馆本身的问题?

我检查了 UI5 的更改日志,但没有看到其中提到的任何内容.

解决方案

我没有看到获取 sap/ui/table/TableExtension.js 失败的错误消息.尝试打开这个

commit:5e3848d(自 1.74 起可用)),文件 TableExtension.js 被重构.但这不应该导致 404 问题.据 Andreas Kunz 称,UI5 在 CDN 中存在缓存失效问题.

此类缓存问题会影响您的应用程序这一事实表明您的应用程序正在引导,但 CDN URL 中没有具体版本.要解决此问题,请引导 UI5 资源(例如在 index.html 中):

  • 使用特定版本:

    <script id="sap-ui-bootstrap" src="https://ui5.sap.com/1.74.1/resources/sap-ui-core.js">

  • 或者利用缓存破坏器:

    <script id="sap-ui-bootstrap" src="resources/sap-ui-cachebuster/sap-ui-核心.js">

改进 bootstrap 步骤后,该表应该可以再次正常工作而不会出现错误.

手动,您可以通过长按重新加载按钮并选择 清空缓存,如下所示 指南(视频).

I am using the 'SmartTable' control in some SAP cloud foundry UI5 apps.

Since a week or so the table control cannot render anymore using the current release (1.74.1) as the following XHR load fails:

https://sapui5.hana.ondemand.com/resources/sap/ui/table/TableExtension.js

If I force the usage of an older release - eg '1.73.1' - then it works fine and the above resource is found.

Is there something changed with the 'Smart Table' concept I am not aware of or is this an issue with the library itself?

I checked the change logs for UI5 but didn't see anything mentioned there.

解决方案

I don't see the error message that fetching sap/ui/table/TableExtension.js fails.Try opening this Demo Kit sample in an incognito window or in Guest mode, select the fiscal year appropriately (e.g. 1970...2020), and press .

In commit:5e3848d (available since 1.74), the file TableExtension.js was refactored. But that should not be causing the 404 issue. According to Andreas Kunz, UI5 had a cache invalidation issue in CDN.

The fact that such cache issues affect your application indicates that your app is bootstrapping without a concrete version in the CDN URL. To fix this, bootstrap the UI5 resources (e.g. in index.html):

  • With a specific version:

    <script id="sap-ui-bootstrap" src="https://ui5.sap.com/1.74.1/resources/sap-ui-core.js">
    

  • Or by leveraging Cache Buster:

    <script id="sap-ui-bootstrap" src="resources/sap-ui-cachebuster/sap-ui-core.js">
    

After improving the bootstrap step, the table should work again without the error.


Manually, you can empty cache by long-pressing the reload button and selecting as shown in this guide (video).

这篇关于SmartTable 控件自 1.74 起有内部加载资源错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-12 04:10