I'd really like it if each page initialization had a "registration"
pass where it quickly ran through the .page and .html file and yanked out
all the .css, .js, meta-tags and whatnot from each component and collected
them at the page level.
That way a component designer could define a set of "page-level"
resources either in the .jwc or as annotations in the java and those
resources would just show up in any page upon which you dropped the
component.
The more I work with the Tapestry component model, the more struck I
am that it's not *quite* there. It's like 96% of the way to being a truly
pluggable architecture, but there are all these little gotchas that make
every step less clean than it ought to be :(.
Just yesterday I got bit by two bits of uncleanliness:
1) You need an @Body component if the component you want to use has
javascript functionality. If you don't have an @Body component and just, for
example, have <body>, there's no exception thrown, no warning message, it
just doesn't work.
2) You need to manually link any .css for the component into the
page if you want it to look right.
It's probably too late to do anything like this for Tap 4 though :(.
--- Pat
> -----Original Message-----
> From: Filip S. Adamsen [mailto:[EMAIL PROTECTED]
> Sent: Saturday, August 27, 2005 4:21 AM
> To: Tapestry users
> Subject: Re: Questions about Components and StyleSheets
>
> Hensley, Richard wrote:
> > I'm not sure the whole of Iscript support is needed. One of the primary
> > reasons for the @Script component is so that Tapestry generated id's
> can be
> > used in a JavaScript. Is that really needed for CSS?
> >
> > Richard
>
> This is not needed for CSS as far as I'm concerned. A way to include
> component *instance* specific CSS in the <head/>'s <style/> section
> would be nice to have, though. Perhaps just a simple component taking an
> IComponent parameter and some CSS.
>
> I'm currently working on solving this whole CSS matter, actually. Check
> the thread "CSS in page or component" for more information regarding
> this - including an example. I'll work on the component instance
> specific CSS inclusion too.
>
> -Filip
>
> >
> > -----Original Message-----
> > From: Fernando Padilla [mailto:[EMAIL PROTECTED]
> > Sent: Friday, August 26, 2005 4:17 PM
> > To: Tapestry users
> > Subject: Re: Questions about Components and StyleSheets
> >
> > Could someone with more time and hunger just spend a week to duplicate
> > and adapt the IScript support for stylesheets? It's a minor oversight
> > to not have done it from the beginning, but I think it's time to bring
> > this kind of support into the core Tapestry.
> >
> > It seems possible, or am I missing something. It looks to be the same
> > ideas as the IScript support, just IStyle, and instead of the @Body
> > injecting javascript, the @Shell would inject css into the head.
> >
> > but then again, I could just be naive.
> >
> >
> > Hensley, Richard wrote:
> >
> >>Patrick,
> >>
> >>I used a little trick where I have my shell use a delegate that searches
> >
> > for
> >
> >>stylesheet assets with special names.
> >>
> >>Here is the article I wrote a while ago:
> >>
> >>http://article.gmane.org/gmane.comp.java.tapestry.user/16092
> >>
> >>This makes it as simple as putting an asset declarations in your
> >
> > component.
> >
> >>Richard
> >>
> >>-----Original Message-----
> >>From: Patrick Casey [mailto:[EMAIL PROTECTED]
> >>Sent: Friday, August 26, 2005 3:38 PM
> >>To: 'Tapestry users'
> >>Subject: Questions about Components and StyleSheets
> >>
> >>
> >>
> >> What's the textbook/preferred/whatever way that a component
> >>gets
> >>its CSS onto a page? So far as I can tell, I can:
> >>
> >>
> >>
> >> Put it in a @Shell component, but that Shell only takes one
> >>CSS,
> >>so if a page requires > 1 css file, the shell doesn't work, does it?
> >>
> >> Manually link them in via any tags, which seems to work for
> >>me.
> >>
> >> Manually add a <script></script> block to your .html file
> >>and
> >>cut/paste the css in.
> >>
> >> Cut/Paste all component styles into one "master" CSS file
> >>and
> >>then link that one file via the @Shell.
> >>
> >>
> >>
> >> All of these approaches though require that the programmer
> >>(that's me), not only embed the component on the page, but also use one
> >>of
> >>the aforementioned methods to embed that components .css as well
> >>(assuming
> >>the component like contrib.:Palette uses its own CSS).
> >>
> >>
> >>
> >> Is there a way I can set up my page such that the component
> >>can
> >>embed its own css? Or is using a component that has its own css always
> >>going
> >>to be a two step process?
> >>
> >>
> >>
> >> --- Pat
> >>
> >>
> >>
> >> PS Tapestry 3.0.3.
> >>
> >>
> >>---------------------------------------------------------------------
> >>To unsubscribe, e-mail: [EMAIL PROTECTED]
> >>For additional commands, e-mail: [EMAIL PROTECTED]
> >>
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > For additional commands, e-mail: [EMAIL PROTECTED]
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > For additional commands, e-mail: [EMAIL PROTECTED]
> >
> >
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]