• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Constructors
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Constructors


  • Subject: Re: Constructors
  • From: Marek Wawrzyczny <email@hidden>
  • Date: Thu, 6 Nov 2003 12:46:58 +1100

Hi Dave,

Don't use the constructors to set the state of these conditionals. The construction of page content does not actually happen there (think about when you are using cached pages, the constructor does not get called since the page object has already been created).

Instead, create set/get methods for your conditional in your page 1 and page 2 components and use them in your page 3 logic. I would play with overriding the WOComponent awake() method which is called before the page generation stage in each component. Note that page 3 is the parent page and if I am not mistaking, it's awake() method will be called first. Read the API for WOComponent and you will find many very useful methods to override.

Hope that helps a bit.

On Thursday, Nov 6, 2003, at 10:59 Australia/Sydney, David Griffith wrote:

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.

Marek Wawrzyczny

software engineer
-------------------------->
ish group pty ltd
7 Darghan St Glebe 2037 Australia
phone +61 2 9660 1400   fax +61 2 9660 7400
http www.ish.com.au | email email@hidden
_______________________________________________
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.

References: 
 >Re: Constructors (From: David Griffith <email@hidden>)

  • Prev by Date: Re: Constructors
  • Next by Date: Re: Constructors
  • Previous by thread: Re: Constructors
  • Next by thread: Re: Constructors
  • Index(es):
    • Date
    • Thread