On Thu, 10 Feb 2011 23:10:42 -0800
Igor Vaynberg <igor.vaynb...@gmail.com> wrote:

> the problem is indeed that you are sharing state between pages which
> is not allowed. you are doing it via one page passing in an anonymous
> SelectionCallback to another page, which is the same as passing in an
> instance of one page to another.

So anonymous classes between pages are a complete no-go in 1.5? We have
used the template method pattern rather extensively in our current
program. Some pages have methods like onPreviousButtonClicked that are
used like this:

[in OriginalPage.java:]
setResponsePage(new SomePage() {
  @Override protected void onPreviousButtonClicked() {
    setResponsePage(OriginalPage.this);
  }
});

There are other methods that do more than just setResponsePage, but
this illustrates the concept. Pretty much exactly like what is done
with such methods in components all the time.

How do you do this without anonymous classes, or have I misunderstood
something?

Thanks
Carl-Eric

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

Reply via email to