On 27 Apr 2006, at 14:29, James Cicenia wrote:

Hello -

I am developing a new website and decided correctly or incorrectly, to have my wrapper page(s) be the main page and then swap out the content in the wrapper with the switch component.

My question is.. normally I have code like nextPage.setEC(ec), etc.,

How do I do this with my architecture as the wrapper really is the next page?

Implement a new abstract subclass of WOComponent called something like WrapperArchitectureComponent. Add an ivar and accessors for the editing context etc. Override a couple of significant methods, eg awake(), appendToResponse(), takeValuesFromRequest() and invokeAction (), to call another method -- wrapperHelper() maybe? -- and then call super.

wrapperHelper() should look something like this:

public void wrapperHelper() {
    if (ec==null) setEC((WrapperArchitectureComponent)parent().ec());
}

Make all your wrapped components and the wrapper inherit from WrapperArchitectureComponent, and in the wrapper page class itself, override
wrapperHelper():

public void wrapperHelper() {}

This isn't the only way of dealing with this, but all the good ways seem to involve making an abstract subclass of WOComponent to encapsulate as much of the plumbing as possible.


Or is what I am doing just wrong?

Almost certainly!

-- Patrick

_______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list      ([email protected])
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/webobjects-dev/archive%40mail-archive.com

This email sent to [email protected]

Reply via email to