oEvent使用此代码时我可以使用:
onPressDialog: function(oEvent) {
if (!this._oDialog) {
this._oDialog= sap.ui.xmlfragment("idDialog", "com.Dialog", this);
this.getView().addDependent(this._oDialog);
}
this._oDialog.setBindingContext(oEvent.getSource().getParent().getBindingContext());
this._oDialog.open();
},
但是,我正在尝试使用它来更改它Fragment.load,但我无法oEvent从该函数中获取它。任何想法?
onPressDialog: function(oEvent) {
if (!this._oDialog) {
Fragment.load({ // Fragment required from "sap/ui/core/Fragment"
id: this.getView().getId(),
name: "com.Dialog",
controller: this
}).then(function(oDialog) {
this.getView().addDependent(oDialog);
oDialog.setBindingContext(/*Can't access the right oEvent values here*/);
oDialog.open();
}.bind(this));
}
},
Cats萌萌
相关分类