No it does not. When you click the second window's close button, it
tells you to close the window with the link inside window instead.
That's intentional and demonstrates that you can suppress the action
on close button.
Your problem is that you have modal window with panel inside modal
window
It turns out if you have a modal within an iframe (i.e. backed by a page) and
want a secondary modal, that modal also needs to be in an iframe.
Incidentally, the problem occurs in one of the wicketstuff examples. If you
go to:
We have a modal window which is backed by a page/iframe (I'll refer to this
as the primary modal). On this page-based modal window there is link which
brings up another modal window, which is not backed by a page (I'll call
this the secondary modal).
We have OK and Cancel buttons on this