Re: Inserting contents in <head>
Re: Inserting contents in <head>
- Subject: Re: Inserting contents in <head>
- From: "Jerry W. Walker" <email@hidden>
- Date: Mon, 6 Mar 2006 10:01:00 -0500
Hi, Vincent,
On Mar 6, 2006, at 9:24 AM, email@hidden wrote:
Dear Jerry
Thanks for the information and the advice, but I am not sure how to
redesign to avoid putting anything into <head></head>. Specifically
the component uses some CSS that is indepdent of any other CSS in the
document, and therefore I wanted to embed it in the head so that
multiple instances of the component only emit it once. I suppose I
can put it into the <body> but it just seemed cleaner to shove it in
<head>.
Any suggestions on redesign would be appreciated, I am very new to
WebObjects so any tips are appreciated.
Lachlan Deck just provided a nice alternative to this today on this
mailing list. Check for his message with Subject: "Making a dynamic
Style sheet, suggestions" submitted at 8:46 AM EST.
You might find exactly what you're looking for there. Good luck.
Regards,
Jerry
Vincent
---- Original Message ----
From: email@hidden
To: email@hidden
Subject: Re: Inserting contents in <head>
Date: Mon, 6 Mar 2006 07:32:56 -0500
Hi, Vincent,
I have the feeling that a different design might obviate the need
for
this and would suggest some thought along those lines. However, if
there seems to be no design of the various components that would
avoid this problem, then try the following.
I've never done this, but I think that if you ask your component for
its parent (using parent()) and it returns null, you will know that
your component is not embedded (that is the part I'm not sure
about).
If that's the case, then create two PageWrapper components that
embed
your component with a WOComponentContent dynamic element. Call one
of
these NullWrapper and the other FullWrapper.
The content of each of these page wrapper components should be
identical comprising a single WOComponentContent element. However,
make one with the full page header and the other with none (a
partial
page component).
Then, embed your original page's content within a WOSwitchComponent
and set its WOComponentName binding to addHead which references the
following method in your original page Java file:
public String addHead()
{
if (parent() == null) {
return "FullWrapper";
}
return "NullWrapper";
}
This will probably work (if parent() returns null as I suspect), but
it seems like a kludge and begs for a higher level redesign.
Good luck.
Regards,
Jerry
--
__ Jerry W. Walker,
WebObjects Developer/Instructor for High Performance Industrial
Strength Internet Enabled Systems
email@hidden
203 278-4085 office
_______________________________________________
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