The PushButton handler executes noch after disabling & # 8594; enable in GWT

I turned off the button and turned on this button with a timer (for example, this sample), I do not move the mouse pointer down the button. as a result, the button is turned on, but sometimes I can’t click on it or it does not fire an event.

Edit: it works with the default button, not the PushButton button

btntest.addClickHandler( new ClickHandler() { @Override public void onClick( ClickEvent event ) { btntest.setEnabled( false ); Timer t = new Timer() { @Override public void run() { btntest.setEnabled( true ); } }; t.schedule( 1000 ); } } ); 
+4
source share
2 answers

Try setEnable (false) in Scheduler # scheduleDeferred, and not directly inside ClickHandler.

0
source

This is a known bug, but there is a workaround. Both are described at https://github.com/gwtproject/gwt/issues/8657

0
source

All Articles