1

Inside my <ui:composition..> code block, everything that I try to render with <h:outputText ..> tag, does not obey the classes definied in <h:outputStylesheet library="css" name="imagens/index.css">:

Here's my code:

<ui:composition ...>
    <ui:define name="conteudoRodape">
       <h:outputStylesheet  library="css" name="imagens/index.css">
           <h:outputText styleClass="centro" value="Acessando como: Filial:" />
       </h:outputStylesheet>
       ...
    </ui:define>
</ui:composition>

How is this caused and how can I solve it?

BalusC
  • 1,082,665
  • 372
  • 3,610
  • 3,555
  • 1
    What exactly is your concrete problem? This construct would only cause the nested `h:outputText` not being rendered at all, but the stylesheet itself should be loaded just fine (provided that the library and name are correct). Do you get a 404 on the CSS resource? Or are styles been overridden? Or was all turned into pink? Etc. Please elaborate the problem in developer's perspective, not in enduser's perspective. – BalusC Oct 02 '12 at 23:40

1 Answers1

0

I think your problem is that you're nesting an h:outputText tag inside h:outputStylesheet, as well as using the library name in the name attribute. Try changing:

<h:outputStylesheet  library="css" name="imagens/index.css">
<h:outputText styleClass="centro" value="Acessando como: Filial:" />
</h:outputStylesheet>

to:

<h:outputStylesheet library="css/imagens" name="index.css" />
Jordan Denison
  • 2,649
  • 14
  • 14
  • With regard to the `library` attribute, please read http://stackoverflow.com/questions/11988415/what-is-the-jsf-resource-library-for-and-how-should-it-be-used – BalusC Oct 02 '12 at 23:41
  • Ahhh yes, thank you : ) Also, his concrete problem was that the h:outputText is not being styled (likely because it is nested) – Jordan Denison Oct 02 '12 at 23:45
  • No, it wouldn't have appeared in the HTML output at all. That's something entirely different than "style not being obeyed". – BalusC Oct 02 '12 at 23:51