You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by ron <ro...@gmx.net> on 2005/03/02 13:50:40 UTC

adding css references

I guess adding an css reference from inside a component is a rather 
frequent issue.

If I am using Shell, can I add such a reference from my component 
somewhere in the live-cycle?

Where should I do it?  finishLoad(...) ? enterActiveState(...) ? 
setContainer(...) ? setPage(...) ?

Cheers,
Ron


---------------------------------------------------------------------
To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tapestry-user-help@jakarta.apache.org


Re: adding css references

Posted by ron <ro...@gmx.net>.
ציטוט Ramin:
Thanx, this would have been great, only my thinking at the time is 
towards a reusable component and not a working solution.

Something like the body.addScript(...), which can add a css reference 
from each component withit the body.

>I'm a Tapestry newbie, so I don't know much about it ... but I've done
>what you are trying to do using SiteMesh. It allows you to define your
><title>, <head>, <meta>'s, etc in any file and then "mesh" it together
>with your decorator template (which is the equivalent of the Border in
>tapestry I believe) You can use SiteMesh on any page that uses a
>servlet engine (tomcat, jboss, etc.). Its a filter..
>
>google SiteMesh to learn more...
>
>On Wed, 02 Mar 2005 14:36:55 +0100, ron <ro...@gmx.net> wrote:
>  
>
>>I don't really check that:
>>
>>I can add the css to my Shell manually from my Border component,
>>but the css is a part of the component, and I would like the component
>>to add it to the <head>.
>>The component is not part of the Head, and apears somewhere inside the Body.
>>
>>ציטוט Kevin Menard:
>>
>>    
>>
>>>Hi Ron,
>>>
>>>On Mar 2, 2005, at 8:12 AM, ron wrote:
>>>
>>>      
>>>
>>>>The question is again, where, or how, in the component lifecycle I
>>>>can add to the pages "stylesheets" property my Asset ?
>>>>can I do it from the jwc? (best !)
>>>>or from the component's Java Class ?
>>>>        
>>>>
>>>I'm confused, why do you need to access the stylesheet? The browser
>>>will render your component in the page with the stylesheet reference.
>>>So, just use your class/id/whatever css constructs you're going to use
>>>in the component. At render time, everything gets glued together
>>>appropriately.
>>>
>>>      
>>>
>>---------------------------------------------------------------------
>>To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
>>For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
>>
>>
>>    
>>
>
>
>  
>


---------------------------------------------------------------------
To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tapestry-user-help@jakarta.apache.org


Re: adding css references

Posted by Andreas Andreou <an...@di.uoa.gr>.
That's a really nice and useful component.
I would really like Tapestry to include and support it by default in 3.1
However, it really needs 2 minor changes (for completeness' sake)...
1. Somehow allow informal parameters, because the link tag can take more 
parameters (i.e. name, media...)
2. Allow the value for the rel and type parameter to be overriden, 
i.e.possible values for rel are:
    stylesheet, alternate stylesheet, icon, shortcut icon
Respect,
    Andreas

Didier LAFFORGUE wrote:

>There is a patch submitted in JIRA for the Tapestry framework.
>The url: http://issues.apache.org/jira/browse/TAPESTRY-199
>=> download the tapestry sources + apply the patch + recompile the sources in order to have a new tapestry-framework.jar.
>
>I use it in all my components and it works very fine ! You have just to declare a Style component in your .jwc or .page. This component needs to have a asset (either a private-asset for your components packaged in a library for example or a context-asset for your pages).
>
>If you have a problem, mail me. Hope that it helps you.
>tchuss.
>
>  Did
>
>
>----- Original Message -----
>From: "ron" <ro...@gmx.net>
>To: "Tapestry users" <ta...@jakarta.apache.org>
>Sent: Wednesday, March 02, 2005 3:53 PM
>Subject: Re: adding css references
>
>  
>
>  
>


---------------------------------------------------------------------
To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tapestry-user-help@jakarta.apache.org


Re: adding css references

Posted by ron <mp...@vollbio.de>.
Thanx, I will take a look - this is just what I was looking for :)


ציטוט Didier LAFFORGUE:

>There is a patch submitted in JIRA for the Tapestry framework.
>The url: http://issues.apache.org/jira/browse/TAPESTRY-199
>=> download the tapestry sources + apply the patch + recompile the sources in order to have a new tapestry-framework.jar.
>
>I use it in all my components and it works very fine ! You have just to declare a Style component in your .jwc or .page. This component needs to have a asset (either a private-asset for your components packaged in a library for example or a context-asset for your pages).
>
>If you have a problem, mail me. Hope that it helps you.
>tchuss.
>
>  Did
>
>  
>


---------------------------------------------------------------------
To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tapestry-user-help@jakarta.apache.org


Re: adding css references

Posted by Didier LAFFORGUE <di...@capgemini.com>.
There is a patch submitted in JIRA for the Tapestry framework.
The url: http://issues.apache.org/jira/browse/TAPESTRY-199
=> download the tapestry sources + apply the patch + recompile the sources in order to have a new tapestry-framework.jar.

I use it in all my components and it works very fine ! You have just to declare a Style component in your .jwc or .page. This component needs to have a asset (either a private-asset for your components packaged in a library for example or a context-asset for your pages).

If you have a problem, mail me. Hope that it helps you.
tchuss.

  Did


----- Original Message -----
From: "ron" <ro...@gmx.net>
To: "Tapestry users" <ta...@jakarta.apache.org>
Sent: Wednesday, March 02, 2005 3:53 PM
Subject: Re: adding css references


> Thanx - it will do at the time. I guess css is not handled as script
> which can be added at arbitrary positions in the body...
>
>
>
> ציטוט Bryan Lewis:
>
> >Similar questions have come up a couple of times before in the list.  Try:
> >
> >http://marc.theaimsgroup.com/?l=tapestry-user&w=2&r=1&s=multiple+stylesheets&q=b
> >
> >
> >
> >----- Original Message -----
> >From: "Ramin" <i8...@gmail.com>
> >To: "Tapestry users" <ta...@jakarta.apache.org>
> >Sent: Wednesday, March 02, 2005 8:45 AM
> >Subject: Re: adding css references
> >
> >
> >I'm a Tapestry newbie, so I don't know much about it ... but I've done
> >what you are trying to do using SiteMesh. It allows you to define your
> ><title>, <head>, <meta>'s, etc in any file and then "mesh" it together
> >with your decorator template (which is the equivalent of the Border in
> >tapestry I believe) You can use SiteMesh on any page that uses a
> >servlet engine (tomcat, jboss, etc.). Its a filter..
> >
> >google SiteMesh to learn more...
> >
> >On Wed, 02 Mar 2005 14:36:55 +0100, ron <ro...@gmx.net> wrote:
> > 
> >
> >>I don't really check that:
> >>
> >>I can add the css to my Shell manually from my Border component,
> >>but the css is a part of the component, and I would like the component
> >>to add it to the <head>.
> >>The component is not part of the Head, and apears somewhere inside the
> >>   
> >>
> >Body.
> > 
> >
> >>ציטוט Kevin Menard:
> >>
> >>   
> >>
> >>>Hi Ron,
> >>>
> >>>On Mar 2, 2005, at 8:12 AM, ron wrote:
> >>>
> >>>     
> >>>
> >>>>The question is again, where, or how, in the component lifecycle I
> >>>>can add to the pages "stylesheets" property my Asset ?
> >>>>can I do it from the jwc? (best !)
> >>>>or from the component's Java Class ?
> >>>>       
> >>>>
> >>>I'm confused, why do you need to access the stylesheet? The browser
> >>>will render your component in the page with the stylesheet reference.
> >>>So, just use your class/id/whatever css constructs you're going to use
> >>>in the component. At render time, everything gets glued together
> >>>appropriately.
> >>>
> >>>     
> >>>
> >>---------------------------------------------------------------------
> >>To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
> >>For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
> >>
> >>
> >>   
> >>
> >
> >
> > 
> >
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tapestry-user-help@jakarta.apache.org

This message contains information that may be privileged or confidential and is the property of the Capgemini Group. It is intended only for the person to whom it is addressed. If you are not the intended recipient,  you are not authorized to read, print, retain, copy, disseminate,  distribute, or use this message or any part thereof. If you receive this  message in error, please notify the sender immediately and delete all  copies of this message.


---------------------------------------------------------------------
To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tapestry-user-help@jakarta.apache.org


Re: adding css references

Posted by ron <ro...@gmx.net>.
Thanx - it will do at the time. I guess css is not handled as script 
which can be added at arbitrary positions in the body...



ציטוט Bryan Lewis:

>Similar questions have come up a couple of times before in the list.  Try:
>
>http://marc.theaimsgroup.com/?l=tapestry-user&w=2&r=1&s=multiple+stylesheets&q=b
>
>
>
>----- Original Message ----- 
>From: "Ramin" <i8...@gmail.com>
>To: "Tapestry users" <ta...@jakarta.apache.org>
>Sent: Wednesday, March 02, 2005 8:45 AM
>Subject: Re: adding css references
>
>
>I'm a Tapestry newbie, so I don't know much about it ... but I've done
>what you are trying to do using SiteMesh. It allows you to define your
><title>, <head>, <meta>'s, etc in any file and then "mesh" it together
>with your decorator template (which is the equivalent of the Border in
>tapestry I believe) You can use SiteMesh on any page that uses a
>servlet engine (tomcat, jboss, etc.). Its a filter..
>
>google SiteMesh to learn more...
>
>On Wed, 02 Mar 2005 14:36:55 +0100, ron <ro...@gmx.net> wrote:
>  
>
>>I don't really check that:
>>
>>I can add the css to my Shell manually from my Border component,
>>but the css is a part of the component, and I would like the component
>>to add it to the <head>.
>>The component is not part of the Head, and apears somewhere inside the
>>    
>>
>Body.
>  
>
>>ציטוט Kevin Menard:
>>
>>    
>>
>>>Hi Ron,
>>>
>>>On Mar 2, 2005, at 8:12 AM, ron wrote:
>>>
>>>      
>>>
>>>>The question is again, where, or how, in the component lifecycle I
>>>>can add to the pages "stylesheets" property my Asset ?
>>>>can I do it from the jwc? (best !)
>>>>or from the component's Java Class ?
>>>>        
>>>>
>>>I'm confused, why do you need to access the stylesheet? The browser
>>>will render your component in the page with the stylesheet reference.
>>>So, just use your class/id/whatever css constructs you're going to use
>>>in the component. At render time, everything gets glued together
>>>appropriately.
>>>
>>>      
>>>
>>---------------------------------------------------------------------
>>To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
>>For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
>>
>>
>>    
>>
>
>
>  
>


---------------------------------------------------------------------
To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tapestry-user-help@jakarta.apache.org


Re: adding css references

Posted by Bryan Lewis <br...@maine.rr.com>.
Similar questions have come up a couple of times before in the list.  Try:

http://marc.theaimsgroup.com/?l=tapestry-user&w=2&r=1&s=multiple+stylesheets&q=b



----- Original Message ----- 
From: "Ramin" <i8...@gmail.com>
To: "Tapestry users" <ta...@jakarta.apache.org>
Sent: Wednesday, March 02, 2005 8:45 AM
Subject: Re: adding css references


I'm a Tapestry newbie, so I don't know much about it ... but I've done
what you are trying to do using SiteMesh. It allows you to define your
<title>, <head>, <meta>'s, etc in any file and then "mesh" it together
with your decorator template (which is the equivalent of the Border in
tapestry I believe) You can use SiteMesh on any page that uses a
servlet engine (tomcat, jboss, etc.). Its a filter..

google SiteMesh to learn more...

On Wed, 02 Mar 2005 14:36:55 +0100, ron <ro...@gmx.net> wrote:
> I don't really check that:
>
> I can add the css to my Shell manually from my Border component,
> but the css is a part of the component, and I would like the component
> to add it to the <head>.
> The component is not part of the Head, and apears somewhere inside the
Body.
>
> ציטוט Kevin Menard:
>
> > Hi Ron,
> >
> > On Mar 2, 2005, at 8:12 AM, ron wrote:
> >
> >>
> >> The question is again, where, or how, in the component lifecycle I
> >> can add to the pages "stylesheets" property my Asset ?
> >> can I do it from the jwc? (best !)
> >> or from the component's Java Class ?
> >
> >
> > I'm confused, why do you need to access the stylesheet? The browser
> > will render your component in the page with the stylesheet reference.
> > So, just use your class/id/whatever css constructs you're going to use
> > in the component. At render time, everything gets glued together
> > appropriately.
> >
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
>
>


-- 
- Ramin

---------------------------------------------------------------------
To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tapestry-user-help@jakarta.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tapestry-user-help@jakarta.apache.org


Re: adding css references

Posted by Ramin <i8...@gmail.com>.
I'm a Tapestry newbie, so I don't know much about it ... but I've done
what you are trying to do using SiteMesh. It allows you to define your
<title>, <head>, <meta>'s, etc in any file and then "mesh" it together
with your decorator template (which is the equivalent of the Border in
tapestry I believe) You can use SiteMesh on any page that uses a
servlet engine (tomcat, jboss, etc.). Its a filter..

google SiteMesh to learn more...

On Wed, 02 Mar 2005 14:36:55 +0100, ron <ro...@gmx.net> wrote:
> I don't really check that:
> 
> I can add the css to my Shell manually from my Border component,
> but the css is a part of the component, and I would like the component
> to add it to the <head>.
> The component is not part of the Head, and apears somewhere inside the Body.
> 
> ציטוט Kevin Menard:
> 
> > Hi Ron,
> >
> > On Mar 2, 2005, at 8:12 AM, ron wrote:
> >
> >>
> >> The question is again, where, or how, in the component lifecycle I
> >> can add to the pages "stylesheets" property my Asset ?
> >> can I do it from the jwc? (best !)
> >> or from the component's Java Class ?
> >
> >
> > I'm confused, why do you need to access the stylesheet? The browser
> > will render your component in the page with the stylesheet reference.
> > So, just use your class/id/whatever css constructs you're going to use
> > in the component. At render time, everything gets glued together
> > appropriately.
> >
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
> 
> 


-- 
- Ramin

---------------------------------------------------------------------
To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tapestry-user-help@jakarta.apache.org


Re: adding css references

Posted by ron <ro...@gmx.net>.
I don't really check that:

I can add the css to my Shell manually from my Border component,
but the css is a part of the component, and I would like the component 
to add it to the <head>.
The component is not part of the Head, and apears somewhere inside the Body.


ציטוט Kevin Menard:

> Hi Ron,
>
> On Mar 2, 2005, at 8:12 AM, ron wrote:
>
>>
>> The question is again, where, or how, in the component lifecycle I 
>> can add to the pages "stylesheets" property my Asset ?
>> can I do it from the jwc? (best !)
>> or from the component's Java Class ?
>
>
> I'm confused, why do you need to access the stylesheet? The browser 
> will render your component in the page with the stylesheet reference. 
> So, just use your class/id/whatever css constructs you're going to use 
> in the component. At render time, everything gets glued together 
> appropriately.
>


---------------------------------------------------------------------
To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tapestry-user-help@jakarta.apache.org


Re: adding css references

Posted by Kevin Menard <ni...@negativetwenty.net>.
Hi Ron,

On Mar 2, 2005, at 8:12 AM, ron wrote:
>
> The question is again, where, or how, in the component lifecycle I can 
> add to the pages "stylesheets" property my Asset ?
> can I do it from the jwc? (best !)
> or from the component's Java Class ?

I'm confused, why do you need to access the stylesheet?  The browser 
will render your component in the page with the stylesheet reference.  
So, just use your class/id/whatever css constructs you're going to use 
in the component.  At render time, everything gets glued together 
appropriately.

-- 
Kevin


---------------------------------------------------------------------
To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tapestry-user-help@jakarta.apache.org


Re: adding css references

Posted by ron <ro...@gmx.net>.
I have another idea:

I add a page property: stylesheets, type java.util.Map

to the Shell I add a binding: name="stylesheets" expression="stylesheets".

Fine.

The question is again, where, or how, in the component lifecycle I can 
add to the pages "stylesheets" property my Asset ?
can I do it from the jwc? (best !)
or from the component's Java Class ?

Cheers,
Ron



ציטוט ron:

> I guess adding an css reference from inside a component is a rather 
> frequent issue.
>
> If I am using Shell, can I add such a reference from my component 
> somewhere in the live-cycle?
>
> Where should I do it? finishLoad(...) ? enterActiveState(...) ? 
> setContainer(...) ? setPage(...) ?
>
> Cheers,
> Ron
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
>
>


---------------------------------------------------------------------
To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tapestry-user-help@jakarta.apache.org