Quantcast
Channel: SCN : All Content - SAPUI5 Developer Center
Viewing all articles
Browse latest Browse all 6178

How to call 2 functions but have the second start once first function is complete

$
0
0

Hello,

 

In my view I 2 functions that are called on a button click, the first function is a delete function and its deletes certain data from the model, and then the second function for the button click event is a calculation function that recalculates data from the model.

 

new sap.ui.commons.Button({                            text: "Delete",                            press: function () {                                oController.doDelete();                                oController.handleCalc();                            }

 

But both are executing at the same time and the second function is calculating values based off of before the delete function has updated the model with, so it is calculating old data.

 

How do I go around this? I want the calculation method to occur once the delete method is finished with updating the model.

 

                           // Update the Global Model data                           sap.ui.getCore().getModel().setData(oData2, false)

Thanks!


Viewing all articles
Browse latest Browse all 6178

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>