Sapui5 加载组件的更改失败
启动应用程序时,我收到以下错误消息: 加载ZMM_CLASSIFICATION.Component的更改失败! 错误代码:404 这是因为smartFilterBar:Sapui5 加载组件的更改失败,sapui5,Sapui5,启动应用程序时,我收到以下错误消息: 加载ZMM_CLASSIFICATION.Component的更改失败! 错误代码:404 这是因为smartFilterBar: <smartFilterBar:SmartFilterBar id="SelectionFilterBar" entitySet="ZMM_C_CLASSIFICATION" search="onSearchClass"> <smartFilterBar:controlConfiguration>
<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>
更新
我调试了应用程序并看到:
UI5尝试下载appversion,但失败。如果您在
WEBIDE
环境中的SAPUI5
应用程序中收到以下两个错误,即缺少/appconfig/fioriSandboxConfig.json
和加载对…组件的更改失败,如下图所示:
然后,只需添加以下.json
文件,其中正文为空-仅将{}作为内容放入*.json文件-
中,您就不会再看到错误
在webapp
文件夹旁边创建一个新文件夹并将其命名为appconfig
,然后在此新文件夹内创建一个新文件并将其命名为fioriSandboxConfig.json
,最后添加{}
作为json
文件的内容李>
在Component.js
文件旁边创建一个新文件,将其命名为Component changes.json
,并再次填充{}
刷新你的应用程序,检查从控制台消失的错误
由于某些原因,我们在Fiori Launchpad
中没有看到这些错误消息。您能找到解决方法吗?似乎当我们使用任何智能项目并希望移动到对象视图时,它会尝试加载组件的旧版本!!!我终于找到了解决办法。
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");
}
});
});