Instead of storing requests targets you should store your own serialized callbacks that create request targets when executed.
-Matej On Fri, May 22, 2009 at 3:34 PM, Juan G. Arias <juangar...@gmail.com> wrote: > I have this link, that I create in different ways. It performs some logic, > and then redirects to somewhere, depending on how was created. > Here is the code: > > class SignOutLink extends Link { > private IRequestTarget target; > > public SignOutLink(String id, Class redirectPage) { > this(id, new BookmarkablePageRequestTarget(redirectPage)); > } > > public SignOutLink(String id, String url) { > this(id, new RedirectRequestTarget(url)); > } > > public SignOutLink(String id, IRequestTarget target) { > super(id); > this.target = target; > } > > public void onClick() { > this.signOutSession(); > this.redirectSignInPage(); > } > > public abstract void signOutSession(); > > public void redirectSignInPage() { > this.getRequestCycle().setRequestTarget(this.target); > } > } > > > On Thu, May 21, 2009 at 8:08 PM, Matej Knopp <matej.kn...@gmail.com> wrote: > >> IRequestTarget is valid only for one request. Why do you want to keep >> as instance variable? >> >> -Matej >> >> On Thu, May 21, 2009 at 11:48 PM, Juan G. Arias <juangar...@gmail.com> >> wrote: >> > Hi all, >> > I want to mantain an IRequestTarget in my component, as an instance >> > attribute. But wicket cries about it's not serializable. >> > Of course, it's right. IRequestTarget is not serializable. >> > >> > Why? Is something wrong with mantain a request target inside my >> component? >> > >> > Thanks! >> > Juan >> > >> >> --------------------------------------------------------------------- >> 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