Wicket Modal dialog, I love you more when you abuse me like this.
I just updated this story to include the solution to my problem at the bottom of the page...
The following describes a problem that i had with the wicket modal dialog and how I fixed my code to solve my problem. The problem is only appearing in Firefox, and not in Safari
I am in the midst of writing my first full application with wicket. I love the Modal Dialog. However, anytime I brought it up from my very nested panel, the content that I wanted to appear within the dialog would be written to the main screen. Like this...
What is wrong with the image below is that the "ajax search" button should actually be on the dialog. The dialog content is appearing on the main screen, not the dialog.

I was thinking that it was because I was invoking the modal dialog from a nested panel because I could bring the same Dialog up from the home page without a problem. THEN, i wrote a quickie test invoking my Modal dialog from a nested panel, and crap! it worked fine. Being the stubborn developer (NOT ME or my code!), I did another test, bringing up the Modal from a twice nested dialog, and as you may have guessed, it worked fine. Obviously, there was something "special" with my nested panels in the same way that someone can be "special" for eating their own buggers in grade school.
As I reviewed my nested panels, make double certain that my html templates were valid xml, I noticed that my Dialog was within a table. Totally valid html of course.
Something like this:
<table>
<tr>
<td>
<div wicket:id="modalWindow">modalWindow</div>
</td>
</tr>
</table>
I did a $2 quickie, by removing my modalWindow from within the table, placing it at the top level of my template, and voila, it worked! Here it is now:

My lesson in all of this god-awful writing is to NOT put your wicket template placeholders for a dialog inside anything like a table.
RESOLVED!!!!!
When I developed a second dialog, I saw that it wasn't broken like my first dialog, despite that it was being invoked from within a table cell. As it turned out, I had invalid html (malformed xhtml) in my dialog html. Make sure that every piece of your wicket application is valid xhtml, it can be cause problems with your ajax behaviors.

Comments
Post new comment