not exactly everytime you click you would do:
{contentpanel.replace(newpanel); contentpanel=newpanel; } the last line: contentpanel=newpanel; frees up the reference to the old panel which will be garbage collected -igor On Sun, Apr 12, 2009 at 8:55 PM, quiqueq <hbore...@gmail.com> wrote: > > > How can I be sure that there is only 1 instance of somepanel? If the user > clicks 10 times the link, 10 different panels would be created in memory. > > > igor.vaynberg wrote: >> >> you should only create the panels when the user clicks on the link >> >> add(new link(..) { >> onclick() { >> panel=new somepanel(...); >> ((mypage)getpage()).setcontentpanel(panel); >> } >> } >> >> -igor >> > > -- > View this message in context: > http://www.nabble.com/Refreshing-page---onBeforeRender%28%29-issue-tp23016450p23017567.html > Sent from the Wicket - User 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 > > --------------------------------------------------------------------- To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org