Thanks. I am not sure whether you meant after the div element or after the div start tag. So I tried both.
After the element: <div wicket:id="loadModalWindow"></div> And after the start tag: <div wicket:id="loadModalWindow"></div> Both gave me this exception (which I did not before I started implementing your advice): Caused by:org.apache.wicket.WicketRuntimeException Message: No Page found for component [OpenOnLoadModalWindow [Component id = loadModalWindow]] This is how the code looks like: Label scriptLabel = new Label("js", loadModalWindow.renderScript()); add(loadModalWindow); add(scriptLabel); The amended code of OpenOnLoadModalWindow: public void renderHead(IHeaderResponse response) { response.render(OnLoadHeaderItem.forScript(getCloseJavacript())); } public final String renderScript() { return getWindowOpenJavaScript(); } Martin Grigorov-4 wrote > [...] > this will render the JS when the whole page DOM is constructed > you can add > right after the modal's div > and use a Label("js", getWindowOpenJavaScript()) > [...] Best regards, J.K. Baltzersen -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/Modal-dialog-box-to-appear-upon-page-load-is-too-late-tp4663551p4663561.html Sent from the Users forum mailing list archive at Nabble.com. --------------------------------------------------------------------- To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org