I want to add two different logics to a button click. The button click should send two requests to the server, so that when the first requests finishes, the second starts. The first request should disable some other buttons on the page, while the second requests executes the main logic which takes some time. My problem is that I can't seem to bind the actions in the order I want, and the also happen in one request. I tried adding a clickListener to the button so that it would execute the first button disabling logic and the main button action is the time intensive logic, but it is executed in the wrong order, and in one request.