首页 > 解决方案 > 加载组件更改失败

问题描述

当我启动应用程序时,我收到以下错误消息:

加载 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

解决方案


如果您SAPUI5在环境中的应用程序中收到以下 2 个WEBIDE关于缺少的错误/appconfig/fioriSandboxConfig.jsonLoading changes for ...Component failed如下图所示:

控制台输出中的错误消息

然后只需添加以下.json带有空正文的文件,- only put {} as the content in the *.json files-您就不会再看到错误了。

  1. 在文件夹旁边webapp新建一个文件夹并命名appconfig,然后在这个新文件夹内新建一个文件并命名fioriSandboxConfig.json,最后添加{}json文件内容。
  2. 在文件旁边Component.js创建一个新文件并为其命名Component-changes.json并再次填充{}

刷新您的应用程序以检查从控制台消失的错误!

在 WEBIDE 中创建的文件

由于某些原因,我们在Fiori Launchpad.


推荐阅读