I have a submit button in a <VBox>
. On press of it, I have an order creation process. If I click multiple times on the button, multiple orders are created. Is there a way I can disable it after the first click?
I have written the following code in my controller, but it seems to be still hearing to the press action:
onSubmit: function(oEvent) {
this.getView().byId("save").setVisible(false);
//......
},
But this does not disable completely. Though in console, when I check using getEnabled()
, it is set to false
. How to stop the button from listening to press event when disabled?
I can suggest the following solutions:
In my opinion, these approaches are more UI5 specific. Personally I would choose the option 2, as it shows the state of processing something in a more prominent way to the user.