I'm looking to enhance the display of the Wicket (6.x) ModalDialog by displaying with the jQuery fadeIn() method as opposed to the default behavior of simply showing the dialog. I started by modifying the modal.js doShow() method to remove the styling as noted below.
var doShow = Wicket.bind(function() {
this.adjustOpenWindowZIndexesOnShow();
// don't want to blatantly show
//this.window.style.visibility="visible";
}, this);
This seems to have the intended effect. I then modified my AJAX logic that was displaying the dialog to call the fadeIn function. This is where things went south. The "alert" in the code snippet below is called properly, but neither of the JavaScripts I'm including appear to be executed. In looking at the HTML after handling the initial click (that should be displaying my dialog), I'm no longer seeing the content I expect in my modal window.
protected void showDialog(AjaxRequestTarget argTarget) {
argTarget.appendJavaScript("alert('hello test '+$('#imageWindow'));");
argTarget.appendJavaScript("$('#"+imageModalWindow.getMarkupId()+"').fadeIn(1000);");
imageModalWindow.show(argTarget);
// even try to reset visibility
argTarget.appendJavaScript("$('#"+imageModalWindow.getMarkupId()+"').css({'visibility':'visible'});");
}
Any suggestions at this point are welcome. I have the id (and Wicket id) for the imageWindow both set in my HTML and Java code. I have the output markup id set to true, but it appears that I'm missing something fairly basic in having my JavaScript executed. Beyond the immediate problem, I'm wondering if there isn't a better way to handle this.
Extend the modalwindow and override the getWindowOpenJavaScript() or getShowJavaScript() method, i dont have a chance to have a deeper look but i think u need getShowJavaScript(). Checkout the javascript it returns and then u should be able to see if u can simply append the fadeIn code or need to completely change the javascript.