Thanks for the suggestion. I have been using close(target) - unfortunately attached a run when I was using both methods. Even with one ajax response appended it doesn't work.
New to JS - can you tell me how to test the variables. If I add var status = window.parent.Wicket.Window; as part of my JS - I get permission denied exception as reported by firebug. My html file includes a head section with my javascript and the markup has wicket elements viz where the close links are rendered. I have two such links - both of which are rendered useless when used in this configuration - although the main close button of the modalwindow continues to work. thanks > Date: Tue, 15 Sep 2009 18:00:47 -0300 > Subject: Re: Unable to close ModalWindow 1.4.1 > From: [email protected] > To: [email protected] > > by close(target) or ModalWindow.close(target) > --> use close(target), to maintain ModalWindow internal states updated. > > On Tue, Sep 15, 2009 at 5:56 PM, Pedro Santos <[email protected]> wrote: > > > 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/ > >> > > > > _________________________________________________________________ Bing brings you health info from trusted sources. http://www.bing.com/search?q=pet+allergy&form=MHEINA&publ=WLHMTAG&crea=TXT_MHEINA_Health_Health_PetAllergy_1x1
