I'm implementing pop up screen on save button as OK and cancle.when i press OK on popup it should hit the oDATA for which I have impelmented the code as shown below.
Detail controller:
onPress: function(){
MessageBox.confirm("Would you like to Save the Material Document No?",{
title: "Confirmation of Material Doc No/Reservation No",
onClose: this.handleOnClose
});
},
handleOnClose: function(status){
debugger;
if(status === "OK"){
var oEntry = {};
oEntry.Mblnr = this.getView().byId("idMaterial").getText();
oEntry.Mjahr = this.getView().byId("idYear").getText();
oEntry.Rsnum = this.getView().byId("idReservation").getText();
var oModel = this.getView().getModel();
oModel.create("/SaveDataSet", oEntry, null, {
success : function() {
MessageToast.show("Your data has been saved successfully");
},error: function() {
MessageToast.error("Material Exist In table");
}
});
But oEntry.Mblnr = this.getView().byId("idMaterial").getText(); is giving error
Uncaught TypeError: this.getView is not a function