Subwindow not shown until I change tabs or show it twice

I have 2 tabs. a button in one of the tabs opens a subwindow.
the problem is that the subwindow is only shown if I click the button twice or if I click the button once and then switch to another tab.
is there some known typical mistake developers make in this area?

        ListSelectionDialog newWindow = new ListSelectionDialog(title, items, valueListener);
        windowProvider.getWindow().addWindow(newWindow);

(Vaadin 6.7.3)

Hard to know what is happening with just this.

How are you creating that window ?
It looks like you are doing it from another thread, if yes check
this sticky
.

If not, please copy on the forum the click handler code to see what is happening.

Another possibility is that the component triggering the event is not in immediate mode. However, a Button should always be immediate by default so I suspect this is an issue with background threads as Mathias suggested.

Thank you, guys! I removed the background thread and it works fine now.