Disable button on click

Hello,

The scenario is as such that I have a light box which contains a button. Now on click of that button, I would like to disable it during the processing and then if my processing succeeded I would like to close the light box OR if the processing failed, tell the user the same and then enable the button again.

Is this possible? I’m going quite mad trying to do this. Saying button.setEnabled(false) within the ClickListener just does not work.

Thanks!

  • Dinesh.

Disabling the button in the ClickListener probably works fine but the change won’t be rendered until the click listener has finished. If you are doing lengthy processing in the listener, start a background thread instead and disable the button. For information on how to update the UI when the background thread has finished, see

http://vaadin.com/forum/-/message_boards/message/231271
.

I’m curious…how do you create the light box effect with Vaadin?