在 SAP 中,從控制器中的另一個方法呼叫事件函式


建議不要從任何其他函式呼叫事件函式,但是你可以在單獨的函式中重構事件函式實現並從其他任何函式中呼叫它,如下所示

示例

BtnPress: function(oEvent) {
   // Separate the implementation in the helper function
   this.btnPressHelper();
}

// Define the helper
btnPressHelper: function() {
   //logic here
}

// call the helper from whichever function you want to get the desired output
PerformSomething: function() {
   this.btnTapHelper();
}

更新於:2019 年 12 月 18 日

531 次瀏覽

點燃你的職業生涯

透過完成課程獲得認證

開始學習
廣告