cancel
Showing results for 
Search instead for 
Did you mean: 

BindElement same path issue

former_member489109
Participant
319

Hi experts,

I trying to rebind Dialog. First time it is working but second time it is not working. Because bindElement is not working with same path.I have to rebind Dialog.

So what can I do to trigger the event with bindElement even if the path is the same? What can I do before bindElement code?

View Entire Topic
boghyon
Product and Topic Expert
Product and Topic Expert
0 Kudos

If the model is v2.ODataModel, calling invalidateEntry before bindElement/bindObject might help. See https://stackoverflow.com/a/59398119/5846045.

former_member489109
Participant
0 Kudos

Thanks but It didn't work. (Detail12Dialog.js?eval:26 Uncaught TypeError: oModel.invalidateEntry is not a function )

model : twoway

onBeforeOpenDialog: function () {
var oDialog = this._getDialog();
var sQmnum = this._oParentController.getPropFromViewElemntBinding("Qmnum");
// var sPath = "/altyapiMainSet('" + sQmnum + "')";
var oModel = this._oParentController.getModel();
var sKey = oModel.createKey("altyapiMainSet", {
Qmnum: sQmnum
});
oModel.invalidateEntry(sKey);
var sPath = "/" + sKey;
oDialog.bindElement({
path: sPath,
events: {
change: function (oChangeEvent) {},
dataRequested: function () {},
dataReceived: function (oData) {}
}
});
},
boghyon
Product and Topic Expert
Product and Topic Expert

bozcetin

You're probably using an old version of UI5. The API invalidateEntry is available since 1.52.1. To see which version the app is running with, press Ctrl + Shift + Left Alt + P.

former_member489109
Participant
0 Kudos

Solved. Thank you so much.