Today I ran into problems with wickets ModalWindow. I have got a modal dialog with a list and a form in it. The user can add a row to this list with the form. Problem was that the size of the modal window stayed as it was although the list was growing and growing. Nasty scroll bars appeared around my modal dialog. So I’d like to make the dialog to „auto resize“ on each post.
My solution was simple. I just added this line of code in the onsubmit handler of the ajax button:
It’s like magic. Now the modal dialog always has the proper size 😉
(Tested with wicket version 1.5.5)
EDIT1: also have a look at Williams note below (the first comment)
EDIT2: also consider Nikkes solution!