Required module missing methods

点点圈 提交于 2021-01-28 16:54:57

问题


Is it a bug from UI5 (1.60.2) or I am doing something wrong here?

onSelectPreferredTreatment: function(event) {
  // ...
  const oDialog = new Dialog({/*...*/});
  oDialog.open();
},

VM77446:1 Uncaught TypeError: oDialog.open is not a function
at eval (eval at onSelectPreferredTreatment (Preview.controller.js?eval:NaN), :1:9)
at f.onSelectPreferredTreatment (Preview.controller.js?eval:552)


回答1:


Check the dependency list in your controller. The order of the required modules should reflect the order of available parameters of the callback function exactly.

sap.ui.define([
  "sap/ui/core/mvc/Controller", // 1st
  "sap/m/Dialog", // 2nd
  // ...
], function(Controller/*1st*/, Dialog/*2nd, ...*/) {
  // ...
});

You might also have required some modules twice, similar to https://stackoverflow.com/a/55289688/5846045



来源:https://stackoverflow.com/questions/61120143/required-module-missing-methods

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!