I tried the sample but it works well. The client event is executed immediately in the browser while Eval() or Call() are sent to the client in the response only after the request processing is completed.
Got to the bottom of it, the code below works
clientEvent1.Event = “execute”;
However if clientEvent1 is set to true
It does not work when button1.Eval(“this.setEnabled(false);”); is called
You don’t need to call button.Update(), it’s never needed unless you are adding a custom property to a control. All you need is to add a client event like the sample that Levie posted.
It’s executed on the client the moment the button is clicked. It works for sure.
There are a couple different ways you can approach this issue.
As you click a normal button, the clicks are stored and processed in the order they arrive.
You can set dropDuplicateClicks: true in the Default.json file to prevent the clicks from queuing up and only firing when the first click has completed processing for the Button, CheckBox, RadioButton, and MenuItem controls)
You can also attach an “execute” handler in ClientEvents that calls “this.setEnabled(false);” to disable the control whenever it’s pressed on the client. You’ll need to update the server, setting Button.Enabled = false as well to reflect the change.
I’ve attached a sample project demonstrating these methods!
Does this help clarify?
Please login first to submit.