webtier@glassfish.java.net

Re: [webtier] JSF 2.0 Resourceloading problem in CSS using outputStyle tag

From: Ryan Lubke <Ryan.Lubke_at_Sun.COM>
Date: Tue, 01 Dec 2009 12:22:34 -0800

On 12/1/09 12:01 PM, webtier_at_javadesktop.org wrote:
> Hi @all!
>
> I'm using Glassfish 2.1.1 with JSF Mojarra 2.0.1 and have the following problem.
>
> I created a [b]composite component[/b] and added the related CSS definition with the new [b]<h:outputStyle>[/b] tag.
> The CSS file contains image path definitions, relative to the CSS location. The problem is that no image will be displayed.
>
> Component:
> [b]...
> <h:outputStylesheet name="components/css/itemList.css"/>
> ...[/b]
>
> CSS:
>
> [b] .itemList table thead .header {
> text-align: left;
> padding-left: 10px;
> background: #ccccff url(../img/table_sort_none.gif) no-repeat center left;
> cursor: pointer;
> }[/b]
>
> After the rendering the image path in CSS looks like this, inspected with firebug:
>
> [b]background: #CCCCFF url(table_sort_none.gif) no-repeat scroll left center[/b]
>
> and the CSS file path:
> http://localhost:7302/vc/javax.faces.resource/components/css/itemList.css.faces
>
> I think the problem is the [b]javax.faces.resource[/b] in the CSS path and the automated flatten of the relative image path.
>
> Does anyone knows a solution for this problem, except to use the old style of linking the CSS file? Or is this a bug?
>
Try:

    background: #ccccff url(#{resource['components/img/table_sort_none.gif']}) no-repeat center left;


> thank you,
> florian
> [Message sent by forum member 'f_schebelle' ]
>
> http://forums.java.net/jive/thread.jspa?messageID=374152
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: webtier-unsubscribe_at_glassfish.dev.java.net
> For additional commands, e-mail: webtier-help_at_glassfish.dev.java.net
>
>