加载组件更改失败
Loading changes for Component failed
当我启动应用程序时,收到以下错误消息:
Loading changes for ZMM_CLASSIFICATION.Component failed!
Error code: 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尝试下载应用版本失败。
如果您在 WEBIDE
环境中的 SAPUI5
应用程序中收到以下 2 个有关缺少 /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
中看不到这些错误消息。
也许您忘记了控制器中的以下内容:
当我启动应用程序时,收到以下错误消息:
Loading changes for ZMM_CLASSIFICATION.Component failed! Error code: 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尝试下载应用版本失败。
如果您在 WEBIDE
环境中的 SAPUI5
应用程序中收到以下 2 个有关缺少 /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
中看不到这些错误消息。
也许您忘记了控制器中的以下内容: