Re: Constructors
Re: Constructors
- Subject: Re: Constructors
- From: David Griffith <email@hidden>
- Date: Thu, 06 Nov 2003 00:59:52 +0100
Hi Michael,
What do you mean exactly?
HeaderFooter page contains a WOComponentContent and a header and footer.
Page 2 contains a Menu which is itself another component, as well as a
WOComponentContent and the whole page is wrapped by HeaderFooter (which is
what I want, can't see any other way to do this). Page 3 contains an image
for example and the entire contents are wrapped by Page 2. The output is
exactly as I want it.
I have defined Page 2 to extend Page 1 (subclassed it) and I have defined
Page 3 to extend Page 2 (subclassed it).
So the way I see it, when I instantiate Page 3, I should and do get a page
which has a header and footer, a menu and my image content.
When looking at Page 3 in WO Builder it can see all the variables and method
of Page 2 and 1 as expected. I can bind and assign to variables which
belong to Page 1 from Page 3 and it works fine. But I need to set some
values while the page is being constructed (in their 'constructor') so that
conditionals can be evaluated and while the construction is happening, all
these values are null.
I have no idea where to go next.
Dave.
> Have you tried to embed the WOComponents with in each other instead?
>
> Michael
> www.aspireauctions.com
>
> On Nov 5, 2003, at 5:46 PM, David Griffith wrote:
>
>> Ok, now that I have a slightly better idea of how components work,
>> here is a
>> scenario:
>>
>> Page 1 Header Footer Page
>> Page 2 Menu Page, wrapper with Header Footer
>> Page 3 Content Page , wrapper with Menu Page
>>
>> Page 2 extends Page 1
>> Page 3 extends Page 2
>>
>> Therefore Page 3 can see and use Page 1 and Page 29s methods and
>> variables.
>>
>> However, when I instantiate Page 3, I get the following constructor
>> calls:
>>
>> Page 1 constructor
>> Page 2 constructor
>> Page 3 constructor (this is much as I expected)
>> Page 1 constructor (again)
>> Page 2 constructor (again)
>> Page 1 constructor (AGAIN).
>>
>> Does this make sense and if so, can someone please tell me why?
>>
>> Also, setting variable values that belong to Page 1 from Page 3
>> results in
>> them being set whilst in the constructor of Page 3 but in all other
>> locations above they are null.
>>
>> Once control returns to Page 3, the values exist. But they are values
>> that
>> the construction process depends on.
>>
>> Regards,
>> Dave.
>> _______________________________________________
>> 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.