On this ajax response, we can see that the close script was appended 2 times. Make sure that it appended only once, by close(target) or ModalWindow.close(target). Before click the "close link", in a moment that was causing trouble, see if these variables are not null:
Wicket.Window.current window.parent.Wicket.Window.current If so, look at what moment they are nullified. The close method called on response: win.current.close() depends on these variables. On Tue, Sep 15, 2009 at 4:54 PM, Ed _ <[email protected]> wrote: > > > Looking for hints to debug the situation I am in. Thanks. > > Using wickets 1.4.1 > > I have tried a simple scenario - opening a page in a modal window and then > using a link in the page to close the window. Works fine. > > Now I am opening a more complicated page with its own javascript - > performing a bunch of operations on that page using js while it is opened in > a modal window. At the end of the operations I hide all the divs and then > show a div that has a "close link" > > The link does not close the modal window - I see the request coming to the > server I call close(target) tried ModalWindow.close(target) too but nothing > happens. > > The window closes with the X close button on the top right. > > the wicket debug shows the operation / at least being able to fetch the > code to shut the window down succeeding . > > > http://hostname/?wicket:interface=mymodalWindow:3:doneInstall::IBehaviorListener:0:&random=0.3818687947575885 > > <?xml version="1.0" encoding="UTF-8"?><ajax-response><evaluate><![CDATA[var > win; > try { > win = window.parent.Wicket.Window; > } catch (ignore) { > } > if (typeof(win) == "undefined" || typeof(win.current) == "undefined") { > try { > win = window.Wicket.Window; > } catch (ignore) { > } > } > if (typeof(win) != "undefined" && typeof(win.current) != "undefined") { > var close = function(w) { w.setTimeout(function() { > win.current.close(); > }, 0); } > try { close(window.parent); } catch (ignore) { close(window); }; > }]]></evaluate><evaluate><![CDATA[var win; > try { > win = window.parent.Wicket.Window; > } catch (ignore) { > } > if (typeof(win) == "undefined" || typeof(win.current) == "undefined") { > try { > win = window.Wicket.Window; > } catch (ignore) { > } > } > if (typeof(win) != "undefined" && typeof(win.current) != "undefined") { > var close = function(w) { w.setTimeout(function() { > win.current.close(); > }, 0); } > try { close(window.parent); } catch (ignore) { close(window); }; > }]]></evaluate></ajax-response> > > _________________________________________________________________ > Hotmail: Free, trusted and rich email service. > http://clk.atdmt.com/GBL/go/171222984/direct/01/ >
