Re: Frameworks and Subcomponents
Re: Frameworks and Subcomponents
- Subject: Re: Frameworks and Subcomponents
- From: Chuck Hill <email@hidden>
- Date: Wed, 4 Nov 2009 10:35:54 -0800
On Nov 4, 2009, at 4:39 AM, David Griffith wrote:
HI all,
I have a questions about reusable components in frameworks. I've
never done this before so please bear with me.
I have an application, let's call it Distributor. This has a
component called Wrapper which is basically the page wrapper I use
for all pages.
I then have another component which I want to make more reusable and
which I would like to use in 3 different apps.
I have that component already put into a framework and that seems
fine. The problem is, the component used to contain an element
which referenced the Wrapper (so that everything would be inside
that). Clearly the 'Wrapper' can and will be different for each
application that I want to use it in. What would be the normal
procedure to do this?
I thought about having a component in my Distributor App that would
hold the reference to the Page Wrapper and inside that would insert
the shared component that I am trying to use. Doing that I am
getting the Page Wrapper but just a blank page where I expect the
component.
Any help would be appreciated.
Another option to consider is to override pageWithName in Application,
e.g.
public WOComponent pageWithName(String aName, WOContext aContext) {
if ("Wrapper".equals(aName)) aName = "CandyBarWrapper";
return super.pageWithName(aName,aContext)
}
It is easy enough automate this by adding a plist resource to each
application containing a dictionary:
{
componentMapping = {
generalName1 = customNameInthisApp1;
generalName2 = customNameInthisApp2;
etc.
}
}
Chuck
--
Chuck Hill Senior Consultant / VP Development
Practical WebObjects - for developers who want to increase their
overall knowledge of WebObjects or who are trying to solve specific
problems.
http://www.global-village.net/products/practical_webobjects
_______________________________________________
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