【问题标题】:SAPUI5 - 'getService' of undefinedSAPUI5 - 未定义的“getService”
【发布时间】:2018-04-19 16:02:42
【问题描述】:

我正在使用 shell 进行变体管理。我在 FLP 中遇到未定义错误的“getService”。添加以下库后,它起作用了。

索引.html

    <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

    "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

【问题讨论】:

  • 请向我们展示您在应用中使用的代码。您显示的文件用于在开发期间运行应用程序,而不是用于从启动板运行应用程序。
  • @SAPFioriCrew 我已经编辑了我的问题。这是我用于在启动板中运行应用程序的索引文件

标签: sapui5 sap-fiori


【解决方案1】:

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

应用所需的库必须在需要它们的 javascript 文件中定义。

【讨论】:

  • 感谢您的回复。将 SAPUI 版本从 740 升级到 752 使其工作。
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2018-09-21
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多