This is a rewrite of the "show modal dialog with a page" example from wicket. Though we do not use pages (which come with some limitations) but instead use panels (without the limitation of not supporting nested panels). The twist here is that we use the same modal panel not only for the modal, but also the page and more nested modals, to allow you to test out the maximum of possible modals your browser can handle (as long as you can handle all the clicking). Also note how you can easily pass state from a nested modal to its parent by making each aware of the other (this is a lot easier in the models and allows more freedom than wickets solution, since the modal does not actually have to know its parent (page) and can thus more easily be reused, though nothing prevents you from doing tight coupling).

Last Modal Window Result:

Show modal dialog with panel