sapui5 - 加载组件更改失败
问题描述
当我启动应用程序时,我收到以下错误消息:
加载 ZMM_CLASSIFICATION.Component 的更改失败!错误代码:404
它的发生是因为 smartFilterBar:
<smartFilterBar:SmartFilterBar id="SelectionFilterBar" entitySet="ZMM_C_CLASSIFICATION" search="onSearchClass">
<smartFilterBar:controlConfiguration>
<smartFilterBar:ControlConfiguration key="ClassType" preventInitialDataFetchInValueHelpDialog="false"></smartFilterBar:ControlConfiguration>
<smartFilterBar:ControlConfiguration key="ClassNum" preventInitialDataFetchInValueHelpDialog="false"></smartFilterBar:ControlConfiguration>
</smartFilterBar:controlConfiguration>
</smartFilterBar:SmartFilterBar>
网络流量显示:
似乎无法访问接口。
我究竟做错了什么?
提示:第一次启动应用程序,一切正常。刷新应用程序后,我收到错误消息。
组件文件内容:
sap.ui.define([
"sap/ui/core/UIComponent",
"sap/ui/Device",
"ch/mindustrie/ZMM_CLASSIFICATION/model/models"
], function (UIComponent, Device, models) {
"use strict";
return UIComponent.extend("ch.mindustrie.ZMM_CLASSIFICATION.Component", {
metadata: {
manifest: "json"
},
/**
* The component is initialized by UI5 automatically during the startup of the app and calls the init method once.
* @public
* @override
*/
init: function () {
// call the base component's init function
UIComponent.prototype.init.apply(this, arguments);
// enable routing
this.getRouter().initialize();
// set the device model
this.setModel(models.createDeviceModel(), "device");
}
});
});
更新
我调试了应用程序并看到:
UI5 尝试下载appversion 失败。
解决方案
如果您SAPUI5
在环境中的应用程序中收到以下 2 个WEBIDE
关于缺少的错误/appconfig/fioriSandboxConfig.json
,Loading changes for ...Component failed
如下图所示:
然后只需添加以下.json
带有空正文的文件,- only put {} as the content in the *.json files-
您就不会再看到错误了。
- 在文件夹旁边
webapp
新建一个文件夹并命名appconfig
,然后在这个新文件夹内新建一个文件并命名fioriSandboxConfig.json
,最后添加{}
为json
文件内容。 - 在文件旁边
Component.js
创建一个新文件并为其命名Component-changes.json
并再次填充{}
。
刷新您的应用程序以检查从控制台消失的错误!
由于某些原因,我们在Fiori Launchpad
.
推荐阅读
- hiveql - 使用 Hive 计算夜班员工的出勤日期
- reactjs - 避免动态创建的功能组件中的陈旧状态
- python - 如何加快数据拟合并获得百分位函数
- javascript - 调整屏幕大小时显示 flex 不起作用
- html - 使用 CSS HTML 将两个控件放在同一行
- mongodb - MongoDB 新数据库实例创建
- python - 如何将参数传递给python函数错误
- amazon-web-services - 使用预签名的 url 从客户端将文件上传到 AWS S3。我怎样才能知道文件何时完成上传?
- javascript - 在 HTML 中通过 Postgres 数组/json 分离 Bootstrap 徽章
- cron - crontab 表达式来安排 DAG 在特定时间间隔内运行