I call bindElement of the view to execute the webservice and get data. The call is executed correctelly if the key of tha path is different. The event "dataReceived" didn't trigger in the second time of the same path.
Example:
- First Time:
I call bindElement with the path 'ABCD', it's working, dataReceived is trigerred.
- The second time:
If I call the same path 'ABCD', noting is happend, the event dataReceived didn't trigger.
If I call another path 'EFGH', it's working and dataReceived is trigerred.
So what can I do to trigger the event with bindElement even if the path is the same ?
Thanks.
cb = this.getView().byId("cb").getValue();
vpath = "/ZDECL_INSet('"+ cb +"')";
this.getView().bindElement({
path: vpath,
mode: sap.ui.model.BindingMode.TwoWay,
events: {
dataReceived: function(rData) {
var data = vthis.getView().getModel().getProperty(rData.oSource.sPath);
msg = "";
if(data.TMSG1 == 'E'){
msg = data.Msg1;
sap.m.MessageBox.show(msg, {
icon: sap.m.MessageBox.Icon.ERROR,
title: vtitle,
actions: [sap.m.MessageBox.Action.YES],
onClose: function(oAction) {
oCB.focus();
oCB.setValue(null);
}
}
);
}
else{
sap.m.MessageToast.show("Good", {
duration: 2000,
width: "200px"
});
oCB.focus();
oCB.setValue(null);
}
}
}
});