SAPUI5 - ' getService'未定义的

时间:2018-04-16 15:36:51

标签: sapui5 sap-fiori

我正在使用shell进行变体管理。我得到了“getService”#39; FLP中未定义的错误添加下面的库后,它工作。

的index.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&amp; sap.ushell.services库工作。

以下是我得到的错误

Error -1

Error -2

没有&#39; ui5service&#39;在&#39; ushell&#39;

sap.ushell

1 个答案:

答案 0 :(得分:0)

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

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