我正尝试使用帮助程序类在xml视图中调用方法,如文档中所述 https://sapui5.hana.ondemand.com/#/topic/b0fb4de7364f4bcbb053a99aa645affe
<Button text="Press Me" press="ZUI5.ZTESTAPP.TestClass.handlePress.call($controller, 'Hello World')"/>
但是该对象在jQuery.sap.getObject中没有得到解析(返回未定义)。
这是帮助程序类代码
sap.ui.define(["sap/ui/base/Object"],
function (Object) {
"use strict";
var o = Object.extend("ZUI5.ZTESTAPP.TestClass", {
constructor: function(){
},
initalize: function(oView){
this._view = oView;
},
handlePress: function(oEvent){
debugger;
//alert('Message Set');
}
});
return o;
});
答案 0 :(得分:0)