thejartender
thejartender

Reputation: 9379

understanding jsfc attribute

I need help with regard to Facelets and specifically the jsfc attribute in HTML tags. I am having difficulty getting understanding if the following will work.

<head jsfc="h:head">
    <ui:insert name="head"/>
    <base href="http://localhost:8080/Jerel-Baker/"/>
        <link jsfc="h:link" rel='stylesheet' type='text/css' href='styles/style.css'/>
        <link jsfc="h:link" rel='stylesheet' media='screen and (max-width: 700px)' href='styles/narrow.css'
              type="text/css"/>
        <link rel='stylesheet' media='screen and (min-width: 701px) and (max-width: 900px)'
              href='styles/medium.css' type="text/css"/>
        <link rel='stylesheet' media='screen and (min-width: 901px)' href="styles/wide.css" type="text/css"/>
        <title>#{msg.title}</title>
</head>

When I put a jsfc="h:link" in each of my link elements, the css is not rendered. I would greatly appreciate any help.

Upvotes: 3

Views: 1610

Answers (1)

BalusC
BalusC

Reputation: 1108567

I'm not sure how it's useful to use jsfc in a plain vanilla output component. At least, the HTML <link rel="stylesheet"> is in JSF not represented by a <h:link>, but by <h:outputStylesheet>. The <h:link> renders a HTML <a> element. Technically, you should be using jsfc="h:ouputStylesheet" instead. I'd just get rid of the attribute since it adds nothing extra here.

Upvotes: 3

Related Questions