How to start a delayed action

Hi,
I’m explaining :

IHM:
A user click on a button A
SERVER:
on click button A: after a delay → set button A disabled

====
the delay must be executed in js on IHM, et after the delay ,button need to be refresh by a call from IHM to SERVER.

thks.

Bertrand

I don’t quite see why it’s a problem that the Button-clicked-Event is sent immediately on the server – you could set a timer on the server side and after a while then disable the button.
This is relatively easy and basically what you need if I only read the part above the “====”.
Plain Java, using e.g. Thread.wait() and some locking.

But underneath the “====” you say you want the delay to be ‘executed’ (sic!) in the JavaScript code.
If you’re really sure you want to change the button behaviour on the client (browser) side, then you will have to build your own custom component.
Since it’s “just a button”, you will probably find it’s easiest to use and adapt a GWT button on the client side, rather than implementing everything yourself in JavaScript. Have a look here https://vaadin.com/book/vaadin6/-/page/gwt.integration.html to learn about integrating GWT components.

HTH,
Enver

Thanks a lot for this response.

In fact, my real problem is a with an event blur (from a textfield) which arrive before a clickevent (from a button).
--------------panel----------------
| text field | button VALID |

on blur event textfield => buttonVALID is set enabled, and textfied is set not editabled :: CANCEL
on click event button => saving data on bdd :: VALIDATION

When you click on button VALID => first focus event is managed before click event, and buttonVALID is never clicked…

Bertrand