SAP C4C HTML Mashup initializePane方法里的Inport和Navigation处理

  1. 云栖社区>
  2. 汪子熙>
  3. 博客>
  4. 正文

SAP C4C HTML Mashup initializePane方法里的Inport和Navigation处理

jerrywangsap 2020-03-20 10:43:38 浏览576

在Cloud Application Studio里创建的HTML mashup,保存到C4C后台后,其元数据再被读取到前端消费,格式如下:


我在C4C UI上指定的Mashup参数,URL的值如下:

成功解析出input为Lead_Info_In:


没有按照我期望的情形进行执行:


MashupHTMLContainer.prototype.initializePane = function() {
        var oController = this.getController();
        var oModel = oController.getComponentModel();
        var oEmbeddingcontext = oController.getEmbeddingContext();
        this._oHtmlPage.setController(oController);
        if (oModel) {
            this._createMashupModel(oModel._oData, oEmbeddingcontext);
            // checks if mashup has an inport or not
            if (this._sInport) {
                // creates inport adapter and attaches it to inport events
                this._oInportAdapter = new InportAdapter(this._sInport, oController, true);
                this._oInportAdapter.on("inportFired", $.proxy(this._onInPortFired, this));

                if (!this._oMashupModel.hasHtmlCode()) {
                    // inport and source uri --> fire inport to build complete source uri
                    this._oInportAdapter.refire();
                    if (this._sInport === "ExtensionFieldsInPort") {
                        this._getSourceUriFromModel(this._oMashupModel);
                    }
                }
            } else {
                // no inport and no html content --> source uri already valid
                if (!this._oMashupModel.hasHtmlCode()) {
                    this._getSourceUriFromModel(this._oMashupModel);
                }
            }
        }
    };

没有执行这个refire:

解析出来的aTargets为空:

本文来自云栖社区合作伙伴“汪子熙”,了解相关信息可以关注微信公众号"汪子熙"。