modal childwindow not disappearing

I have following problem: I have a table and below it is a button which says ‘delete’. When hitting the delete-button, a record should be removed out of the database. Now, it is possible that this item in the database links to other objects in the database and in that case i ask the user for a confirmation. I do this by displaying a new window (which i make modal) where the user can click ‘Ok’ or ‘Cancel’.


The clicklistener behind ‘Cancel’ just removes the confirmation window with the code:


Which just works fine. Now when the user clicks ‘Ok’, confirming he want to delete the item and all object that have links to it, I want to perform this task, but because this takes a while, i want to disable the ‘Ok’ and ‘Cancel’ button, so that the user knows it has to wait for the application.

I tried to do this by, in the clicklistener behind the ‘Ok’ button, first disabling the buttons and then starting a new thread where the action is performed. From within this new thread i then want to remove the confirmation window when the task is complete, but this is where i’m stuck. I’ve tried about 100 possibilities to do this, but none of them work. When i debug the app, i eventually see that the childwindow IS removed from the mainwindow, (in the array of childwindows that is part of each Vaadin window), but i don’t see this on the screen. Somehow the client is not notified…

Any suggestions?

In Vaadin, the client is updated on a request-response cycle, so the client-side is not automatically notified of changes that originate in other threads. One solution is to display a ProgressIndicator while the background thread works. This way, the UI is periodically updated and the window removal should show on the client.

Thank you so much!!! that did the trick (and i was looking for that for quite some time ;-))