Re: In WOComponent constructor and need to go to another WOComponent and not come back
Re: In WOComponent constructor and need to go to another WOComponent and not come back
- Subject: Re: In WOComponent constructor and need to go to another WOComponent and not come back
- From: Pierre Bernard <email@hidden>
- Date: Wed, 5 Sep 2007 11:21:56 +0200
Hi!
The constructor is an odd place for this.
The constructor is called from pageWithName(). That is in the request-
response loop preceding the one that would actually use the component.
If you already know at that point in time where you want to go and
where not, you should modify the caller so that pageWithName() is
called with the correct arguments.
There might nonetheless be situations where you may want to forbid
viewing a certain page. E.g. it is a private page and you want a
safety net just in case some day someone writes code that doesn't
check access right before going to the page. For that I would code a
check in the awake() method. If the check fails throw an exception.
Optionally that exception could carry information on where to take the
user. The exception handler in your Application class should take care
of routing the user to the appropriate page.
Pierre
On Sep 5, 2007, at 2:41 AM, Baiss Eric Magnusson wrote:
I'm in the Constructor of a WOComponent sub-class and I realize I
have to be in another page.
I invoke a new <pageWithName>, but then what?
----
Baiss Eric Magnusson
<http://www.Track-Your-Finances.com>
<http://www.CascadeWebDesign.com>
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden