Re: Overriding pageWithName
Re: Overriding pageWithName
- Subject: Re: Overriding pageWithName
- From: Jonathan Rochkind <email@hidden>
- Date: Tue, 20 Jan 2004 15:33:04 -0600
I don't know whether it's documented, but I'm positive that
WOComponent.pageWithName() calls WOApplication.pageWithName().
WODirectAction.pageWithName() does too. WOComponent.pageWithName() is
essentially a convenience method, whose implementation probably looks
an awful lot like this:
public WOComponent pageWithName(String pageName) {
return application().pageWithName(pageName, context() );
}
Ditto for WODirectAction.pageWithName. The WOApplication one is
actually where the work is done, the other two are just convenience
methods that call it. So, no, they are not all guaranteed to call
WOComponent.pageWithName(). Rather they are all guaranteed to call
WOApplication.pageWithName(). And if you want to change
pageWithName behavior on an application-wide basis (say, replacing
one page for another), WOApplication.pageWithName is the one to
override.
Your particular WOApplication subclass has it's contructor called
exactly once, of course, when your application starts up, and never
again. There is only one WOApplication subclass instance existing at
a time in any given WO app, and it's created when the WO app starts
up. (Unless there's some weird non-standard way to have more than
one; at any rate, that's what's standard).
--Jonathan
At 4:21 PM -0500 1/20/04, arturo wrote:
I believe that I need to override pageWithName. Is it documented anywhere
what this actually does?
In particular, the API contains 3 pageWithNames
1. Application.pageWithName().
2. WOComponent.pageWithName().
3. IIRC, WOAction.pageWithName().
Are they all "guaranteed" (ha! we're talking about WO here :-) to call
WOComponent.pageWithName()?
And if so, is that "guaranteed" (ditto) to call the WOComponent.constructor?
Actually, I bet the constructor
doesn't get called for stateless WOComponents except for the first instance.
That way, I just need to override/subclass WOComponent's pageWithName.
Thanks in advance,
-arturo
_______________________________________________
webobjects-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/webobjects-dev
Do not post admin requests to the list. They will be ignored.
_______________________________________________
webobjects-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/webobjects-dev
Do not post admin requests to the list. They will be ignored.