Call event function from another method in Controller in SAP

SAP HANASAPSAP Basis

It is advised not to call the event function from any other function but what you can do is refactor the event function implementation in a separate function and call that from any other function as shown below:

Example

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();
}
raja
Published on 15-Dec-2017 12:35:30
Advertisements