One way to share things between pages is to pass it. For instance:

class MyPage {

  public MyPage(MyClass passMe) {
   ...
  }
}

class OtherPage {
  ...
  class MyForm extends Form {
    public void onSubmit() {

      MyClass toShare = new MyClass();
      setResponsePage(new MyPage(toShare));
    }
  }
}

Furthermore, it is okay to use the session with Wicket. You should
think whether the stuff you want to put in it is *really* for the
whole session, or just a few pages (in which case you would better
pass them). But if you want to use the session, you can use Wicket's
strongly typed session, which you can provide by overriding
getSessionFactory of Application.

Eelco


On 1/20/06, Igor Vaynberg <[EMAIL PROTECTED]> wrote:
>
> On 1/20/06, Rosenstrauch, David
> <[EMAIL PROTECTED]> wrote:
> > Been surfing (and googling) the docs for about an hour now, but haven't
> found the answer to this:
> >
> > In a typical web app you submit a form and (assuming it validates OK) you
> save the data and then navigate/forward to a different page.
> >
> > How does similar functionality work in Wicket?
> > 1) I didn't see any capability to navigate or forward (or how to use <form
> action="">
>
> in the form's onsubmit or the button's onsubmit you call one of the variants
> of Page.setResponsePage() method
>
> > 2) I wasn't clear how to get 2 different WebPage objects to access the
> same piece of state (other than statics/singletons).  IIRC, it's frowned
> upon for your code to access the Session directly.  How else should one do
> it then?
>
> not really sure what you mean here. please explain.
>
> -Igor
>
>


-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
for problems?  Stop!  Download the new AJAX search engine that makes
searching your log files as easy as surfing the  web.  DOWNLOAD SPLUNK!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid3432&bid#0486&dat1642
_______________________________________________
Wicket-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/wicket-user

Reply via email to