Good point.
On Tue, Mar 25, 2008 at 2:01 PM, Maurice Marrink <[EMAIL PROTECTED]> wrote:
> On Tue, Mar 25, 2008 at 1:42 PM, Eric Rotick <[EMAIL PROTECTED]> wrote:
> > Thanks for the help, I'm getting there...slowly!
> >
> > Does this mean that I can't do something like
> >
> > new MyPage1( ).setResponsePage( new MyPage2( ) );
> >
> > and then somewhere else
> >
> > new MyPage1( ).setResponsePage( new MyPage3( ) );
> >
> > Instead I have to add a parameter to all pages that could have a
> variable
> > response page and set that via the setReponsePage in an onSubmit call.
> As in
> >
> > new MyPage1( new MyPage2( ) );
> >
> > and
> >
> > new MyPage1( new MyPage3( ) );
>
> You really should never pass a new Page to another like what you are
> doing here. Instead you should either pass the class of that page or
> if the page you are trying to pass on already has been created because
> you visited it previously then it would be ok to pass it to the
> constructor.
>
> So either do
> onsubmit() // or onclick
> {
> setResponsePage(new MyPage2(MyPage3.class);
> //or
> setResponsePage(new MyPage2(this.getPage());
> //or
> setResponsePage(new MyPage2(pageThatWasPreviouslyConstructed)); //as
> in not constructed in this page
> }
>
> Maurice
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>