You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@wicket.apache.org by stevenson lee <st...@gmail.com> on 2010/06/21 06:05:33 UTC

Close ModalWindow from an applet in it

Hi,
I have an applet within a modal window. I use the applet to access devices
(namely printers) and it is embedded in modal window. I need to close the
modal window after ther printing process...
Is there a way to do this?
I tried triggering a click on the close button in the javascript:
function doCloseWindow(windowId) {
	$("#" + windowId + " w_close").trigger('click');
}

but it doesnt seem to do anything. By the way, I got the windowId using
getMarkUpId() of my modal window component. I am using a panel as the
content for the modal window so I pass the markupId as a constructor and add
it to the modal window as a parameter so i could access it from the applet.
the value i get for the markupId is "printerAppletModala"; I'm not sure if
this is the Id that I should get.

Any help would be greatly appreciated,

Best Regards,

stevenson
-- 
View this message in context: http://apache-wicket.1842946.n4.nabble.com/Close-ModalWindow-from-an-applet-in-it-tp2262125p2262125.html
Sent from the Wicket - User mailing list archive at Nabble.com.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org


Re: Close ModalWindow from an applet in it

Posted by stevenson lee <st...@gmail.com>.
i also tried to take a look at the getCloseJavaScript method
           /**
             * @return javascript that closes current modal window
             */
            private static String getCloseJavacript() {
                return "var win;\n" //
                        + "try {\n"
                        + "	win = window.parent.Wicket.Window;\n"
                        + "} catch (ignore) {\n"
                        + "}\n"
                        + "if (typeof(win) == \"undefined\" ||
typeof(win.current) == \"undefined\") {\n"
                        + "  try {\n"
                        + "     win = window.Wicket.Window;\n"
                        + "  } catch (ignore) {\n"
                        + "  }\n"
                        + "}\n"
                        + "if (typeof(win) != \"undefined\" &&
typeof(win.current) != \"undefined\") {\n"
                        + "	window.parent.setTimeout(function() {\n"
                        + "		win.current.close();\n" + "	}, 0);\n" + "}";
            }
But I'm not sure how to use this. I tried making a function from it. but i
don't think its made to be used that way. The extra braces at the end " + "
}, 0);\n" + "}"; confuses me even more.

Can anyone help?
Best regards,
Stevenson Lee
-- 
View this message in context: http://apache-wicket.1842946.n4.nabble.com/Close-ModalWindow-from-an-applet-in-it-tp2262125p2262145.html
Sent from the Wicket - User mailing list archive at Nabble.com.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org