Hi all you genius people!
Has anybody ever had a problem with modal window’s content when using the web site from behind a proxy? Sadly I cannot provide any details about the proxy configuration. (It’s the proxy of a foreign company.)
I can tell you though that it is a Squid proxy and that there are no explicit error’s in Wicket’s ajax debug windows or the server log. Proxy admin also says there’s nothing blockek in the logs. Wicket actually returns an empty div to be displayed in the modal window’s content:
<div id="contentd" style="display:none"></div>
This is what is returned when I do not have the proxy between me and wicket:
<div id="content10">
<form>
<table align="center" cellspacing="5px" width="100%">
<tr>
<td colspan="2" align="center">
<span><p>Möchten Sie den Monitor wirklich löschen?</p></span>
</td>
</tr>
<tr>
<td align="center">
<input type="button" value="Ok" class="button" id="confirm15" onclick="var wcall=wicketAjaxGet('?wicket:interface=:1:uniModal:content:confirm::IBehaviorListener:0:-1',function() { }.bind(this),function() { }.bind(this), function() {return Wicket.$('confirm15') != null;}.bind(this));return !wcall;">
</td>
<td align="center">
<input type="button" value="Abbrechen" class="button" id="confirmNot16" onclick="var wcall=wicketAjaxGet('?wicket:interface=:1:uniModal:content:confirmNot::IBehaviorListener:0:-1',function() { }.bind(this),function() { }.bind(this), function() {return Wicket.$('confirmNot16') != null;}.bind(this));return !wcall;">
</td>
</tr>
</table>
</form>
</div>
(Sry for this horribly dirty html code, not a work of mine. ^^)
My guess is that the proxy captures parameter’s that should arrive at wicket but never do. I switched on DEBUG for org.apache.wicket but can’t find anything that might seem useful. Does anybody know an instant solution or have any ideas how to look into this further? After DEBUG logging showed nothing I pretty much ran out of ideas.
Maybe someone can read something out of the wicket logs:
- Working without proxy – http://pastebin.com/Agi2JMJM
- Not working with proxy – http://pastebin.com/hfzXDHtq
Thanks in advance!
The actual solution was quite easy, now that I know the details. Wicket uses two custom headers when handling modal windows:
Without these headers wicket seems to be unable to identify the correct modal frame object or similar. The company’s proxy server blocked all non-whitelisted headers. After tweaking the proxy server to allow the headers above everything worked like a charm.