You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by st...@wachovia.com on 2005/01/20 22:00:11 UTC

context-asset - How to render additional attributes for ?

I need to output the following on my pages.

<link href="index.css" rel="stylesheet" type="text/css" media="screen" />
<link href="index-p.css" rel="stylesheet" type="text/css" media="print" />

I attempted something like this on my .page file, 

<context-asset name="stylesheet" path="index.css">
        <property name="media" name="screen"/>
</context-asset>

I checked out the source for Shell.java and this is how the link is being 
rendered.

private void writeStylesheetLink(IMarkupWriter writer, IRequestCycle 
cycle, IAsset stylesheet)
    {
        writer.beginEmpty("link");
        writer.attribute("rel", "stylesheet");
        writer.attribute("type", "text/css");
        writer.attribute("href", stylesheet.buildURL(cycle));
        writer.println();
    }


Anyone have any idea how I would include the additional media attribute? 
Is the property element a step in the right direction? I don't think 
ContextAsset holds any reference to what is defined in the <property> tag. 
Anyone have a similar problem?

Re: {SPAM?} Re: context-asset - How to render additional attributes for ?

Posted by Andreas Andreou <an...@di.uoa.gr>.
Howard,
thanks for the info...
That's just another functionality i never really noticed!
BUT, you can only access these properties from the IAssetSpecification.
The problem is that (unless i'm missing something) there is no clean way 
to access
that object from an IAsset instance.
So the solution i came up to was to pass to a component a String array 
of  asset names
instead of an array of IAsset. Is this really the only way?
And secondly, in order to fully implement the stuff presented at

http://www.alistapart.com/articles/alternate/

we really need an UNINITIALIZE tag defined at the script dtd which 
will contain javascript executed when the page unloads (in this case
storing in a cookie the style selected).
Is this functionality planned for any future version of Tapestry?
I really think that it's a very nice to have functionality which 
does not interfere with other aspects of Tapestry and it's really
backwards compatible.
Andreas Andreou



Howard Lewis Ship wrote:

>Assets are property holders; you can place <property> inside
><context-asset>, etc.
>
>I've been thinking that these properties should be accessible to the
>framework so that certain components can take advantage of them.  For
>example, the Image component could look for a height property.
>
>Similar properties might be useful to the Shell component, when an
>asset is being used as a stylesheet.
>
>
>On Fri, 21 Jan 2005 15:08:08 -0500, Erik Hatcher
><er...@ehatchersolutions.com> wrote:
>  
>
>>Ah, good points!   I definitely agree we should really tackle all of
>>these CSS issues and have a very clean Tapestry-centric way of adding
>>all of this flexibility.
>>
>>A simple IAsset isn't sufficient to capture rel and title.
>>
>>Thoughts on how this stuff should be implemented?
>>
>>        Erik
>>
>>
>>On Jan 21, 2005, at 6:47 AM, Andreas Andreou wrote:
>>
>>    
>>
>>>Currently there's no way for the Shell component to do this out of the
>>>box...
>>>As already proposed the only solution is to create a Delegate class
>>>and specify it in the Shell...
>>>I think that there are some talks to provide such functionality in 3.1
>>>or later in the Shell component, by
>>>passing to it a Map object
>>>Some more notes on this planned functionality:
>>>1) It would be nice to also specify the rel attribute of every css.
>>>Expected values are "stylesheet" but also "alternate stlyesheet"
>>>2) It would also be nice to specify an optional title attribute, i.e.
>>>title="Default style" or title="Groovy style" e.t.c.
>>>All these would provide main and alternative skinning options for your
>>>site and the only way to achive this right now is
>>>with a custom Delegate renderer.
>>>Those who are interested in implementing this, be sure to take a look
>>>at
>>>http://www.alistapart.com/articles/alternate/
>>>Maybe the shell component couls also include the javascript of that
>>>article to enable on the fly skin switching
>>>for browsers that do not support this (IE)
>>>Respect,
>>>   Andy
>>>
>>>Christian Kesselheim wrote:
>>>
>>>      
>>>
>>>>We have done something similar for our application as well.
>>>>Just less elegant :).
>>>>
>>>>(ck)
>>>>
>>>>On Jan 20, 2005, at 10:52 PM, Jamie Orchard-Hays wrote:
>>>>
>>>>        
>>>>
>>>>>In our Border.java file we created:
>>>>>public IRender getDelegate(){ }
>>>>>
>>>>>and then loaded the strings with the css links we needed. Then in
>>>>>Border.html, we call:
>>>>>
>>>>><component id="shell" type="Shell">
>>>>>       <binding name="title" expression="title"/>
>>>>>       <binding name="delegate" expression="delegate"/>
>>>>>       <!--<binding name="stylesheet"
>>>>>expression="stylesheetAsset"/>-->
>>>>>   </component>
>>>>>
>>>>>You can see where we commented the original stylesheet asset
>>>>>binding. A few people have been calling for a way to have multiple
>>>>>stylesheet assets in 3.1.
>>>>>
>>>>>Jamie
>>>>>
>>>>>
>>>>>----- Original Message ----- From: <st...@wachovia.com>
>>>>>To: "Tapestry users" <ta...@jakarta.apache.org>
>>>>>Sent: Thursday, January 20, 2005 4:00 PM
>>>>>Subject: context-asset - How to render additional attributes for
>>>>><link rel="stylesheet">?
>>>>>
>>>>>
>>>>>          
>>>>>
>>>>>>I need to output the following on my pages.
>>>>>>
>>>>>><link href="index.css" rel="stylesheet" type="text/css"
>>>>>>media="screen" />
>>>>>><link href="index-p.css" rel="stylesheet" type="text/css"
>>>>>>media="print" />
>>>>>>
>>>>>>I attempted something like this on my .page file,
>>>>>>
>>>>>><context-asset name="stylesheet" path="index.css">
>>>>>>       <property name="media" name="screen"/>
>>>>>></context-asset>
>>>>>>
>>>>>>I checked out the source for Shell.java and this is how the link is
>>>>>>being
>>>>>>rendered.
>>>>>>
>>>>>>private void writeStylesheetLink(IMarkupWriter writer, IRequestCycle
>>>>>>cycle, IAsset stylesheet)
>>>>>>   {
>>>>>>       writer.beginEmpty("link");
>>>>>>       writer.attribute("rel", "stylesheet");
>>>>>>       writer.attribute("type", "text/css");
>>>>>>       writer.attribute("href", stylesheet.buildURL(cycle));
>>>>>>       writer.println();
>>>>>>   }
>>>>>>
>>>>>>
>>>>>>Anyone have any idea how I would include the additional media
>>>>>>attribute?
>>>>>>Is the property element a step in the right direction? I don't think
>>>>>>ContextAsset holds any reference to what is defined in the
>>>>>><property> tag.
>>>>>>Anyone have a similar problem?
>>>>>>            
>>>>>>
>>>>>
>>>>>---------------------------------------------------------------------
>>>>>To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
>>>>>For additional commands, e-mail:
>>>>>tapestry-user-help@jakarta.apache.org
>>>>>
>>>>>
>>>>>          
>>>>>
>>>>-------------------------
>>>>infeurope S.A.
>>>>62, rue Charles Martel
>>>>L-2134 Luxembourg
>>>>Luxembourg
>>>>Tel: (+352) 25.22.33.1
>>>>Fax: (+352) 25.22.33.222
>>>>
>>>>Web: www.infeurope.lu
>>>>-------------------------
>>>>
>>>>Any views expressed are purely those of the writer and may not in any
>>>>circumstances be regarded as stating an official position of
>>>>infeurope S.A.!
>>>>
>>>>
>>>>---------------------------------------------------------------------
>>>>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
>>>      
>>>
>>---------------------------------------------------------------------
>>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: {SPAM?} Re: context-asset - How to render additional attributes for ?

Posted by Howard Lewis Ship <hl...@gmail.com>.
Assets are property holders; you can place <property> inside
<context-asset>, etc.

I've been thinking that these properties should be accessible to the
framework so that certain components can take advantage of them.  For
example, the Image component could look for a height property.

Similar properties might be useful to the Shell component, when an
asset is being used as a stylesheet.


On Fri, 21 Jan 2005 15:08:08 -0500, Erik Hatcher
<er...@ehatchersolutions.com> wrote:
> Ah, good points!   I definitely agree we should really tackle all of
> these CSS issues and have a very clean Tapestry-centric way of adding
> all of this flexibility.
> 
> A simple IAsset isn't sufficient to capture rel and title.
> 
> Thoughts on how this stuff should be implemented?
> 
>         Erik
> 
> 
> On Jan 21, 2005, at 6:47 AM, Andreas Andreou wrote:
> 
> > Currently there's no way for the Shell component to do this out of the
> > box...
> > As already proposed the only solution is to create a Delegate class
> > and specify it in the Shell...
> > I think that there are some talks to provide such functionality in 3.1
> > or later in the Shell component, by
> > passing to it a Map object
> > Some more notes on this planned functionality:
> > 1) It would be nice to also specify the rel attribute of every css.
> > Expected values are "stylesheet" but also "alternate stlyesheet"
> > 2) It would also be nice to specify an optional title attribute, i.e.
> > title="Default style" or title="Groovy style" e.t.c.
> > All these would provide main and alternative skinning options for your
> > site and the only way to achive this right now is
> > with a custom Delegate renderer.
> > Those who are interested in implementing this, be sure to take a look
> > at
> > http://www.alistapart.com/articles/alternate/
> > Maybe the shell component couls also include the javascript of that
> > article to enable on the fly skin switching
> > for browsers that do not support this (IE)
> > Respect,
> >    Andy
> >
> > Christian Kesselheim wrote:
> >
> >> We have done something similar for our application as well.
> >> Just less elegant :).
> >>
> >> (ck)
> >>
> >> On Jan 20, 2005, at 10:52 PM, Jamie Orchard-Hays wrote:
> >>
> >>> In our Border.java file we created:
> >>> public IRender getDelegate(){ }
> >>>
> >>> and then loaded the strings with the css links we needed. Then in
> >>> Border.html, we call:
> >>>
> >>> <component id="shell" type="Shell">
> >>>        <binding name="title" expression="title"/>
> >>>        <binding name="delegate" expression="delegate"/>
> >>>        <!--<binding name="stylesheet"
> >>> expression="stylesheetAsset"/>-->
> >>>    </component>
> >>>
> >>> You can see where we commented the original stylesheet asset
> >>> binding. A few people have been calling for a way to have multiple
> >>> stylesheet assets in 3.1.
> >>>
> >>> Jamie
> >>>
> >>>
> >>> ----- Original Message ----- From: <st...@wachovia.com>
> >>> To: "Tapestry users" <ta...@jakarta.apache.org>
> >>> Sent: Thursday, January 20, 2005 4:00 PM
> >>> Subject: context-asset - How to render additional attributes for
> >>> <link rel="stylesheet">?
> >>>
> >>>
> >>>> I need to output the following on my pages.
> >>>>
> >>>> <link href="index.css" rel="stylesheet" type="text/css"
> >>>> media="screen" />
> >>>> <link href="index-p.css" rel="stylesheet" type="text/css"
> >>>> media="print" />
> >>>>
> >>>> I attempted something like this on my .page file,
> >>>>
> >>>> <context-asset name="stylesheet" path="index.css">
> >>>>        <property name="media" name="screen"/>
> >>>> </context-asset>
> >>>>
> >>>> I checked out the source for Shell.java and this is how the link is
> >>>> being
> >>>> rendered.
> >>>>
> >>>> private void writeStylesheetLink(IMarkupWriter writer, IRequestCycle
> >>>> cycle, IAsset stylesheet)
> >>>>    {
> >>>>        writer.beginEmpty("link");
> >>>>        writer.attribute("rel", "stylesheet");
> >>>>        writer.attribute("type", "text/css");
> >>>>        writer.attribute("href", stylesheet.buildURL(cycle));
> >>>>        writer.println();
> >>>>    }
> >>>>
> >>>>
> >>>> Anyone have any idea how I would include the additional media
> >>>> attribute?
> >>>> Is the property element a step in the right direction? I don't think
> >>>> ContextAsset holds any reference to what is defined in the
> >>>> <property> tag.
> >>>> Anyone have a similar problem?
> >>>
> >>>
> >>>
> >>> ---------------------------------------------------------------------
> >>> To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
> >>> For additional commands, e-mail:
> >>> tapestry-user-help@jakarta.apache.org
> >>>
> >>>
> >>
> >> -------------------------
> >> infeurope S.A.
> >> 62, rue Charles Martel
> >> L-2134 Luxembourg
> >> Luxembourg
> >> Tel: (+352) 25.22.33.1
> >> Fax: (+352) 25.22.33.222
> >>
> >> Web: www.infeurope.lu
> >> -------------------------
> >>
> >> Any views expressed are purely those of the writer and may not in any
> >> circumstances be regarded as stating an official position of
> >> infeurope S.A.!
> >>
> >>
> >> ---------------------------------------------------------------------
> >> 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
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
> 
> 


-- 
Howard M. Lewis Ship
Independent J2EE / Open-Source Java Consultant
Creator, Jakarta Tapestry
Creator, Jakarta HiveMind

Professional Tapestry training, mentoring, support
and project work.  http://howardlewisship.com

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


Re: {SPAM?} Re: context-asset - How to render additional attributes for ?

Posted by Erik Hatcher <er...@ehatchersolutions.com>.
Ah, good points!   I definitely agree we should really tackle all of 
these CSS issues and have a very clean Tapestry-centric way of adding 
all of this flexibility.

A simple IAsset isn't sufficient to capture rel and title.

Thoughts on how this stuff should be implemented?

	Erik



On Jan 21, 2005, at 6:47 AM, Andreas Andreou wrote:

> Currently there's no way for the Shell component to do this out of the 
> box...
> As already proposed the only solution is to create a Delegate class 
> and specify it in the Shell...
> I think that there are some talks to provide such functionality in 3.1 
> or later in the Shell component, by
> passing to it a Map object
> Some more notes on this planned functionality:
> 1) It would be nice to also specify the rel attribute of every css. 
> Expected values are "stylesheet" but also "alternate stlyesheet"
> 2) It would also be nice to specify an optional title attribute, i.e. 
> title="Default style" or title="Groovy style" e.t.c.
> All these would provide main and alternative skinning options for your 
> site and the only way to achive this right now is
> with a custom Delegate renderer.
> Those who are interested in implementing this, be sure to take a look 
> at
> http://www.alistapart.com/articles/alternate/
> Maybe the shell component couls also include the javascript of that 
> article to enable on the fly skin switching
> for browsers that do not support this (IE)
> Respect,
>    Andy
>
> Christian Kesselheim wrote:
>
>> We have done something similar for our application as well.
>> Just less elegant :).
>>
>> (ck)
>>
>> On Jan 20, 2005, at 10:52 PM, Jamie Orchard-Hays wrote:
>>
>>> In our Border.java file we created:
>>> public IRender getDelegate(){ }
>>>
>>> and then loaded the strings with the css links we needed. Then in 
>>> Border.html, we call:
>>>
>>> <component id="shell" type="Shell">
>>>        <binding name="title" expression="title"/>
>>>        <binding name="delegate" expression="delegate"/>
>>>        <!--<binding name="stylesheet" 
>>> expression="stylesheetAsset"/>-->
>>>    </component>
>>>
>>> You can see where we commented the original stylesheet asset 
>>> binding. A few people have been calling for a way to have multiple 
>>> stylesheet assets in 3.1.
>>>
>>> Jamie
>>>
>>>
>>> ----- Original Message ----- From: <st...@wachovia.com>
>>> To: "Tapestry users" <ta...@jakarta.apache.org>
>>> Sent: Thursday, January 20, 2005 4:00 PM
>>> Subject: context-asset - How to render additional attributes for 
>>> <link rel="stylesheet">?
>>>
>>>
>>>> I need to output the following on my pages.
>>>>
>>>> <link href="index.css" rel="stylesheet" type="text/css" 
>>>> media="screen" />
>>>> <link href="index-p.css" rel="stylesheet" type="text/css" 
>>>> media="print" />
>>>>
>>>> I attempted something like this on my .page file,
>>>>
>>>> <context-asset name="stylesheet" path="index.css">
>>>>        <property name="media" name="screen"/>
>>>> </context-asset>
>>>>
>>>> I checked out the source for Shell.java and this is how the link is 
>>>> being
>>>> rendered.
>>>>
>>>> private void writeStylesheetLink(IMarkupWriter writer, IRequestCycle
>>>> cycle, IAsset stylesheet)
>>>>    {
>>>>        writer.beginEmpty("link");
>>>>        writer.attribute("rel", "stylesheet");
>>>>        writer.attribute("type", "text/css");
>>>>        writer.attribute("href", stylesheet.buildURL(cycle));
>>>>        writer.println();
>>>>    }
>>>>
>>>>
>>>> Anyone have any idea how I would include the additional media 
>>>> attribute?
>>>> Is the property element a step in the right direction? I don't think
>>>> ContextAsset holds any reference to what is defined in the 
>>>> <property> tag.
>>>> Anyone have a similar problem?
>>>
>>>
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
>>> For additional commands, e-mail: 
>>> tapestry-user-help@jakarta.apache.org
>>>
>>>
>>
>> -------------------------
>> infeurope S.A.
>> 62, rue Charles Martel
>> L-2134 Luxembourg
>> Luxembourg
>> Tel: (+352) 25.22.33.1
>> Fax: (+352) 25.22.33.222
>>
>> Web: www.infeurope.lu
>> -------------------------
>>
>> Any views expressed are purely those of the writer and may not in any
>> circumstances be regarded as stating an official position of 
>> infeurope S.A.!
>>
>>
>> ---------------------------------------------------------------------
>> 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


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


Re: {SPAM?} Re: context-asset - How to render additional attributes for ?

Posted by Andreas Andreou <an...@di.uoa.gr>.
Currently there's no way for the Shell component to do this out of the 
box...
As already proposed the only solution is to create a Delegate class and 
specify it in the Shell...
I think that there are some talks to provide such functionality in 3.1 
or later in the Shell component, by
passing to it a Map object
Some more notes on this planned functionality:
1) It would be nice to also specify the rel attribute of every css. 
Expected values are "stylesheet" but also "alternate stlyesheet"
2) It would also be nice to specify an optional title attribute, i.e. 
title="Default style" or title="Groovy style" e.t.c.
All these would provide main and alternative skinning options for your 
site and the only way to achive this right now is
with a custom Delegate renderer.
Those who are interested in implementing this, be sure to take a look at
http://www.alistapart.com/articles/alternate/
Maybe the shell component couls also include the javascript of that 
article to enable on the fly skin switching
for browsers that do not support this (IE)
Respect,
    Andy

Christian Kesselheim wrote:

> We have done something similar for our application as well.
> Just less elegant :).
>
> (ck)
>
> On Jan 20, 2005, at 10:52 PM, Jamie Orchard-Hays wrote:
>
>> In our Border.java file we created:
>> public IRender getDelegate(){ }
>>
>> and then loaded the strings with the css links we needed. Then in 
>> Border.html, we call:
>>
>> <component id="shell" type="Shell">
>>        <binding name="title" expression="title"/>
>>        <binding name="delegate" expression="delegate"/>
>>        <!--<binding name="stylesheet" expression="stylesheetAsset"/>-->
>>    </component>
>>
>> You can see where we commented the original stylesheet asset binding. 
>> A few people have been calling for a way to have multiple stylesheet 
>> assets in 3.1.
>>
>> Jamie
>>
>>
>> ----- Original Message ----- From: <st...@wachovia.com>
>> To: "Tapestry users" <ta...@jakarta.apache.org>
>> Sent: Thursday, January 20, 2005 4:00 PM
>> Subject: context-asset - How to render additional attributes for 
>> <link rel="stylesheet">?
>>
>>
>>> I need to output the following on my pages.
>>>
>>> <link href="index.css" rel="stylesheet" type="text/css" 
>>> media="screen" />
>>> <link href="index-p.css" rel="stylesheet" type="text/css" 
>>> media="print" />
>>>
>>> I attempted something like this on my .page file,
>>>
>>> <context-asset name="stylesheet" path="index.css">
>>>        <property name="media" name="screen"/>
>>> </context-asset>
>>>
>>> I checked out the source for Shell.java and this is how the link is 
>>> being
>>> rendered.
>>>
>>> private void writeStylesheetLink(IMarkupWriter writer, IRequestCycle
>>> cycle, IAsset stylesheet)
>>>    {
>>>        writer.beginEmpty("link");
>>>        writer.attribute("rel", "stylesheet");
>>>        writer.attribute("type", "text/css");
>>>        writer.attribute("href", stylesheet.buildURL(cycle));
>>>        writer.println();
>>>    }
>>>
>>>
>>> Anyone have any idea how I would include the additional media 
>>> attribute?
>>> Is the property element a step in the right direction? I don't think
>>> ContextAsset holds any reference to what is defined in the 
>>> <property> tag.
>>> Anyone have a similar problem?
>>
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
>> For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
>>
>>
>
> -------------------------
> infeurope S.A.
> 62, rue Charles Martel
> L-2134 Luxembourg
> Luxembourg
> Tel: (+352) 25.22.33.1
> Fax: (+352) 25.22.33.222
>
> Web: www.infeurope.lu
> -------------------------
>
> Any views expressed are purely those of the writer and may not in any
> circumstances be regarded as stating an official position of infeurope 
> S.A.!
>
>
> ---------------------------------------------------------------------
> 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: context-asset - How to render additional attributes for ?

Posted by Christian Kesselheim <ck...@infeurope.lu>.
We have done something similar for our application as well.
Just less elegant :).

(ck)

On Jan 20, 2005, at 10:52 PM, Jamie Orchard-Hays wrote:

> In our Border.java file we created:
> public IRender getDelegate(){ }
>
> and then loaded the strings with the css links we needed. Then in 
> Border.html, we call:
>
> <component id="shell" type="Shell">
>        <binding name="title" expression="title"/>
>        <binding name="delegate" expression="delegate"/>
>        <!--<binding name="stylesheet" expression="stylesheetAsset"/>-->
>    </component>
>
> You can see where we commented the original stylesheet asset binding. 
> A few people have been calling for a way to have multiple stylesheet 
> assets in 3.1.
>
> Jamie
>
>
> ----- Original Message ----- From: <st...@wachovia.com>
> To: "Tapestry users" <ta...@jakarta.apache.org>
> Sent: Thursday, January 20, 2005 4:00 PM
> Subject: context-asset - How to render additional attributes for <link 
> rel="stylesheet">?
>
>
>> I need to output the following on my pages.
>>
>> <link href="index.css" rel="stylesheet" type="text/css" 
>> media="screen" />
>> <link href="index-p.css" rel="stylesheet" type="text/css" 
>> media="print" />
>>
>> I attempted something like this on my .page file,
>>
>> <context-asset name="stylesheet" path="index.css">
>>        <property name="media" name="screen"/>
>> </context-asset>
>>
>> I checked out the source for Shell.java and this is how the link is 
>> being
>> rendered.
>>
>> private void writeStylesheetLink(IMarkupWriter writer, IRequestCycle
>> cycle, IAsset stylesheet)
>>    {
>>        writer.beginEmpty("link");
>>        writer.attribute("rel", "stylesheet");
>>        writer.attribute("type", "text/css");
>>        writer.attribute("href", stylesheet.buildURL(cycle));
>>        writer.println();
>>    }
>>
>>
>> Anyone have any idea how I would include the additional media 
>> attribute?
>> Is the property element a step in the right direction? I don't think
>> ContextAsset holds any reference to what is defined in the <property> 
>> tag.
>> Anyone have a similar problem?
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
>
>

-------------------------
infeurope S.A.
62, rue Charles Martel
L-2134 Luxembourg
Luxembourg
Tel: (+352) 25.22.33.1
Fax: (+352) 25.22.33.222

Web: www.infeurope.lu
-------------------------

Any views expressed are purely those of the writer and may not in any
circumstances be regarded as stating an official position of infeurope 
S.A.!


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


Re: context-asset - How to render additional attributes for ?

Posted by Jamie Orchard-Hays <ja...@dang.com>.
In our Border.java file we created:
public IRender getDelegate(){ }

and then loaded the strings with the css links we needed. Then in 
Border.html, we call:

<component id="shell" type="Shell">
        <binding name="title" expression="title"/>
        <binding name="delegate" expression="delegate"/>
        <!--<binding name="stylesheet" expression="stylesheetAsset"/>-->
    </component>

You can see where we commented the original stylesheet asset binding. A few 
people have been calling for a way to have multiple stylesheet assets in 
3.1.

Jamie


----- Original Message ----- 
From: <st...@wachovia.com>
To: "Tapestry users" <ta...@jakarta.apache.org>
Sent: Thursday, January 20, 2005 4:00 PM
Subject: context-asset - How to render additional attributes for <link 
rel="stylesheet">?


>I need to output the following on my pages.
>
> <link href="index.css" rel="stylesheet" type="text/css" media="screen" />
> <link href="index-p.css" rel="stylesheet" type="text/css" media="print" />
>
> I attempted something like this on my .page file,
>
> <context-asset name="stylesheet" path="index.css">
>        <property name="media" name="screen"/>
> </context-asset>
>
> I checked out the source for Shell.java and this is how the link is being
> rendered.
>
> private void writeStylesheetLink(IMarkupWriter writer, IRequestCycle
> cycle, IAsset stylesheet)
>    {
>        writer.beginEmpty("link");
>        writer.attribute("rel", "stylesheet");
>        writer.attribute("type", "text/css");
>        writer.attribute("href", stylesheet.buildURL(cycle));
>        writer.println();
>    }
>
>
> Anyone have any idea how I would include the additional media attribute?
> Is the property element a step in the right direction? I don't think
> ContextAsset holds any reference to what is defined in the <property> tag.
> Anyone have a similar problem? 


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