Fiori元素-在保存时引发对话框

问题描述 投票:-1回答:1

我们已经使用fiori元素创建了列表报告应用。现在,我们想引发一个关于“保存”操作的对话框,因此我们使用了ExtensionAPI for object page extensions

function onDialog(oEvent) {
      	if (!That._oDialog) {
      		sap.ui.core.Fragment.load({
      			name: "MyProject.MyDialog",
      			controller: this
      		}).then(function (oDialog) {
      			That._oDialog = oDialog;
      			That.getView().addDependent(That._oDialog);
      			That._oDialog.getBinding("items").filter(oFilters);
      			That._oDialog.open();
      		}.That(That));
      	} else {
      		That._oDialog.getBinding("items").filter(oFilters);
      		That._oDialog.open();
      	}
}

sap.ui.controller("NextGenerationMaintenanceUI.ext.controller.ObjectPageExt", {      	

onAfterRendering: function () {
      		debugger;
      		this.extensionAPI.getTransactionController().attachAfterSave(onDialog);
      	}
 });

不幸的是,我们无法访问视图控制器并收到错误“ TypeError :(中间值)。这不是函数”

sapui5
1个回答
0
投票

这应该起作用,不要使用它:

 then(function (oDialog) {
                this._oDialog = oDialog;
                this.getView().addDependent(That._oDialog);
            this._oDialog.getBinding("items").filter(oFilters);
                this._oDialog.open();
            }.bind(this))

© www.soinside.com 2019 - 2024. All rights reserved.