Important Notice - Forums is archived
To simplify things and help our users to be more productive, we have archived the current forum and focus our efforts on helping developers on Stack Overflow. You can post new questions on Stack Overflow or join our Discord channel.

Vaadin lets you build secure, UX-first PWAs entirely in Java.
Free ebook & tutorial.
Modal subwindows...
Hi
I am using Vaadin framework 7.5.9 and I have a perculiar situation yet again :).
The thing is that I have Subwindow that is launch from an ordinary button. I set it to Modal when I create it to be able to block any interraction with the UI below during the time the subwindow is up.
So far so good. :)
Now I have the situation that the user accidently double-clicked the add button and I he got double modal window above eachother. And he saved one and was very confused about the other.
My guess is that this can occur since I load stuff into the SubWindow before I show it. That is between the Button.clickListener() and the getUI().addWindow( subWindow ), I create some components and load som data in them... and the users second click happens during that time.
So my question is: How should I handle this? Is there any way to tell Vaadin to ignore the button clicks until the modal window is created? Or something similar?
Best regards
Jani Väinölä
Hi,
you can use the yourbutton.setDisableOnClick(true); property on your button. you need to enable it again once the modal Dialog is closed.
Thanks, that was a great Idea :)
Best Regards
Jani Väinölä