5 Replies Latest reply on Jan 14, 2013 2:38 PM by Hai-Yun Du

    Incorrect order of CSS resource inclusions

    Val Blant Newbie



      I'm seeing a problem with the way css inclusions are rendered in RF4.


      I have some css includes defined explicitly like this:


      <h:outputStylesheet library="theme" name="AgriShareCustomStyles.css" target="head" />

      <h:outputStylesheet library="theme" name="NiftyCorners.css" target="head" />

      <h:outputStylesheet library="theme" name="AgriSharePrintStyles.css" media="print" target="head" />

      <h:outputStylesheet library="theme" name="LhsMenuStyles.css" target="head" />

      <h:outputStylesheet library="theme" name="FloatingMessageStyles.css" target="head" />



      These are added to the view when the <h:head> is done rendering. Then there are the CSS resources required by richfaces components, defined by @ResourceDependency annotations. These are added to the view when the RF component is being added to the tree.


      So we end up with user-specific CSS rendered before RF CSS, which makes it impossible to override RF CSS properties.


      To add to my confusion, RF CSS is rendered before user-specific CSS if there is an error on the page (in FacesContext), so in that case my styles render correctly.


      Does anyone know where this re-ordering is happening, and why it's not happening all the time?