Hi,

I'm trying to create a ModalWindow, something similar to this example:
http://wicketstuff.org/wicket14/nested/?wicket:bookmarkablePage=:org.apache.wicket.examples.ajax.builtin.modal.ModalWindowPage

If I create the modalwindow like this:
final ModalWindow modal = new ModalWindow("modal");
modal.setContent(new RegisterPanel(modal));
modal.setTitle("Registration");
modal.setCookieName("register");
add(new AjaxLink("showModal") {

   @Override
   public void onClick(AjaxRequestTarget target) {
      modal.show(target);
   }
});
add(modal);

then when I construct the page containing this modalwindow, I also will
construct the modalwindow content, but the user can just decide to not
to click on this link, so skip the modal, and then I have an unnecessary
constructed panel.
So I've played a bit with my RegisterPanel, and moved all of my logic to
onInitialize (because it's called before onBeforeRender), to initialize
my stuff there, but it looks like onInitialize is still called without
user action. If I put everything into onBeforeRender, then I can
guarantee, that the constructing logic runs on-demand, but then I will
have problems when user wants to reopen the window. I could create a
field to check whether I already initialized the component in
oBeforeRender, but that sounds like a hack. How can I solve this issue
elegantly?

Thanks,
Peter

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

Reply via email to