首页
学习
活动
专区
圈层
工具
发布
首页
学习
活动
专区
圈层
工具
MCP广场
社区首页 >问答首页 >SAPUI5 -未定义的'getService‘

SAPUI5 -未定义的'getService‘
EN

Stack Overflow用户
提问于 2018-04-16 23:36:51
回答 1查看 1.3K关注 0票数 0

我正在使用shell进行变体管理。我在FLP中得到了未定义错误的'getService‘。在添加下面的库之后,它就可以工作了。

Index.html

代码语言:javascript
运行
复制
    <script>
    window["sap-ushell-config"] = {
        defaultRenderer : "fiori2",
        renderers: {
            fiori2: {
                componentData: {
                    config: {
                        search: "hidden"
                    }
                }
            }
        },
        applications: {
            "OrderTracking-display": {
                additionalInformation: "SAPUI5.Component=orders",
                applicationType: "URL",
                url: ".",
                title: "Order Tracking"
            }
        }
    };
</script>

  <script src="/sap/public/bc/ui5_ui5/resources/sap/ushell_abap/bootstrap/abap.js" id="sap-ushell-bootstrap"></script>  

  <script id="sap-ui-bootstrap"
  src="https://sapui5.hana.ondemand.com/resources/sap-ui-core.js"
  data-sap-ui-libs="sap.ushell, sap.collaboration, sap.m, sap.ui.commons, 
   sap.ui.layout, sap.ui.ux3"
  data-sap-ui-theme="sap_belize"
  data-sap-ui-bindingSyntax="complex"
  data-sap-ui-compatVersion="edge"
  data-sap-ui-resourceroots='{"orders": "."}'
  data-sap-ui-frameOptions="trusted">

manifest.json

代码语言:javascript
运行
复制
    "sap.ui5": {
    "rootView": {
        "viewName": "orders.view.App",
        "type": "XML",
        "async": true,
        "id": "app"
    },
    "dependencies": {
        "minUI5Version": "1.42.0",
        "libs": {
            "sap.ui.core": {},
            "sap.m": {},
            "sap.f": {},
            "sap.ushell": {},
            "sap.collaboration": {
                "lazy": true
            }
        }
    },
    "contentDensities": {
        "compact": true,
        "cozy": true
    },
    "models": {
        "i18n": {
            "type": "sap.ui.model.resource.ResourceModel",
            "settings": {
                "bundleName": "orders.i18n.i18n"
            }
        },
        "": {
            "dataSource": "mainService",
            "preload": true
        }
    },
    "services": {
        "ShellUIService": {
            "factoryName": "sap.ushell.ui5service.ShellUIService",
            "lazy": false,
            "settings": {
                "setHierarchy": "auto",
                "setTitle": "auto"
            }
        }
    },

但我在sap.ushell下找不到ui5service.ShellUIService。另外,弹出窗口和日期选择器也不起作用。如何同时使用sap.ushell.ui5service和sap.ushell.services库。

下面是我得到的错误

Error -1

Error -2

“ushell”下没有“ui5service”

sap.ushell

EN

回答 1

Stack Overflow用户

发布于 2018-04-19 16:02:43

在开发期间,index.html文件用于在测试模式下从WebIDE运行应用程序。创建了一个称为沙盒的本地launchpad来运行该应用程序,但并非launchpad (云或abap)中的所有服务都可用。

应用程序需要的库必须在javascript文件中需要它们的地方定义。

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/49861164

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档