Igor,

Thanks, that works perfectly.

Tauren


On 6/25/07, Igor Vaynberg <[EMAIL PROTECTED]> wrote:
> On 6/25/07, Tauren Mills <[EMAIL PROTECTED]> wrote:
>
> > Hi everyone,
> >
> > I have a page constructor that adds several components.  However,
> > those components are reliant on the existence of an object in the
> > session.  I'd like to test if that object is null, and if it is,
> > redirect the user to a different page where they can make a selection
> > that adds a valid object to the session.
> >
> > When I wrap a test around my constructor code, the page doesn't render
> > if the object in the session is null because it isn't finding the
> > components on the page:
> >
> > WicketMessage: Unable to find component with id 'stateName' ...
> >
> > Here is a simplified version of the code:
> >
> > public RequiresStatePage() {
> >   super();
> >   if (((MySession)getSession()).getState() == null) {
> >     setResponsePage(SetStatePage.class);
> >   } else {
> >     add(new
> Label("stateName",((MySession)getSession()).getState().getName()));
> >     ...
> >   }
> > }
> >
> > What is the proper way to do this?
> >
> > Thanks,
> > Tauren
>
> instead of setResponsePage(SetStatePage.class) do throw new
> RestartResponseException(SetStatePage.class)
>
> -igor

-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
Wicket-user mailing list
Wicket-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wicket-user

Reply via email to