我无法在oData发布成功调用内调用任何自定义函数。
onSubmit: function () {
var that = this; that.onInit();
}
oModel.create("/Entity", postData, {
success: function (oRetrievedResult) {
var that=this;
lv_BusyDialog.close();
var msg = 'Success!';
MessageToast.show(msg);
that.onSubmit();
// This onSubmit is getting not called here.
},
error: function (oError) {
/* do something */
lv_BusyDialog.close();
var msg1 = 'error';
MessageToast.show(msg1);
}
答案 0 :(得分:0)
您的那个变量是本地变量,因此您无法通过onSubmit函数访问它。您可以在 oModel.create 行之前将 this 分配给那个。