I'm able to used oEvent
when using this code:
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();
},
However, I'm trying to change it using Fragment.load
but I'm not able to get the oEvent
from the function. Any idea?
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));
}
},