Hope this helps http://apache-wicket.1842946.n4.nabble.com/opening-ModalWindow-on-page-load-td3055618.html
Proposed solution works for me. Regards, Ernesto. On Fri, Dec 3, 2010 at 9:32 PM, hok <[email protected]> wrote: > > Hello, > I'm trying to open a modal window without ajax request (when the page is > loaded). I've looked at > https://issues.apache.org/jira/browse/WICKET-12 > https://issues.apache.org/jira/browse/WICKET-12 > > but trying the proposed solution does not work in my case. I can see in the > log that the window's panel is created but the window itself does not open > when the page is loaded. The code that I'm using is: > > public class TestPage extends WebPage { > > public TestPage() { > } > > �...@override > protected void onInitialize() { > super.onInitialize(); > > ModalWindow window = new ModalWindow("modal_window") { > private static final long serialVersionUID = > -2976925047468282833L; > > �...@override > protected boolean makeContentVisible() { > if (getWebRequest().isAjax() == false) { > return true; > } else { > return false; > } > } > > }; > window.setContent(new EmptyPanel(window.getContentId())); > add(window); > } > } > > and for the markup file: > > <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" > "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> > <html xmlns="http://www.w3.org/1999/xhtml" > xmlns:wicket="http://wicket.apache.org/" xml:lang="en" lang="en"> > <head> > <title>Wicket test</title> > </head> > <body> > <div wicket:id="modal_window">Modal window</div> > </body> > </html> > > Is there something wrong in the code? Thanks in advance. > -- > View this message in context: > http://apache-wicket.1842946.n4.nabble.com/ModalWindow-open-on-page-load-without-ajax-tp3071714p3071714.html > Sent from the Users forum mailing list archive at Nabble.com. > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [email protected] > For additional commands, e-mail: [email protected] > > --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
