无法加载具有属性的UI5组件。Fiori启动板 [英] Failed to load UI5 component with properties .. Fiori Launchpad

查看:443
本文介绍了无法加载具有属性的UI5组件。Fiori启动板的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在我的应用中有一个自定义控件。它可以作为Web应用程序正常运行。但是当我使用sap fiori启动板运行时,会给我错误。我已将控件注册到index.html文件中。

I've a custom control in my app. it run as a web application fine. but when i'm running with sap fiori launchpad it give me error. I've registered my control in my index.html file

    <script>
        sap.ui.localResources("sap.custom");
        sap.ui.localResources("sap.ui.codetools");
        sap.ui.localResources("libs");

    </script>


文件目录的结构是

the structure of file directory is

如果我删除了自定义控件,则可以运行我的应用在启动板中。我是否需要在清单文件中添加一些设置?造成此错误的原因可能是

If i remove my custom control then i can run my app in launchpad. Do I need to add some settings in my manifest file? What could be the reason for this error

推荐答案

Fiori磁贴的常见配置是指向Component.js文件。因此不会调用index.html。 FioriLaunchpad.html扮演index.html的角色,并在其中定义ComponentContainer。
因此,将路径注册到Component.js文件中。

The common configuration for a Fiori tile is to point to the Component.js file. So the index.html is not called. The FioriLaunchpad.html plays the role of the index.html and the ComponentContainer is defined there. So register your path in the Component.js file.

init: function() {

        //load CodeEditor 
        jQuery.sap.registerModulePath("sap.ui.codetools", "/sap/ui/codetools/");

        UIComponent.prototype.init.apply(this, arguments);

        // set the device model
        this.setModel(models.createDeviceModel(), "device");
    }

通过这种方式,您可以解决问题

in this way you can fix your problem

这篇关于无法加载具有属性的UI5组件。Fiori启动板的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆