在 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();
}

更新時間: 18-12-2019

531 次瀏覽

啟動你的 職業

透過完成課程獲得認證

開始學習
廣告
© . All rights reserved.