-
1. Re: Precedence of custom ecss over those of frameworks
fastroller May 28, 2011 2:04 AM (in response to nikh123123)A bit late on the reply. The best way to override a richfaces eccs is to install it in your resources directory under the library name org.richfaces. E.g. /app-root/resources/org.richfaces/datatable.ecss. Your app's resource directory has precedence over the resources in the richfaces libs. Do not manually include the ecss file using outputStylesheet as this will include both richface's and your own.
This should be included in the richfaces documentation.
-
2. Re: Precedence of custom ecss over those of frameworks
nbelaevski May 28, 2011 2:44 PM (in response to nikh123123)Nikhil,
Actually, the last stylesheet has bigger priority than preceding ones, so the order is correct. Check in Firebug/IE developer toolbar why your styles are not applied.
-
3. Re: Precedence of custom ecss over those of frameworks
fastroller May 28, 2011 3:26 PM (in response to nbelaevski)Nick,
You are correct that in so far as if he included the outputStylesheet in the h:body tag then the stylesheet is added after the richfaces built-in stylesheets. However I have found that if the outputStylesheet is included in the h:head section then it is added before the built-in stylesheets thus has little or no effect. You would use this method if you want to extend (or override) a subset of the built-in style rules for a datatable. My original advice still stands if you want to completely replace the built-in style sheet.
-
4. Re: Precedence of custom ecss over those of frameworks
nbelaevski May 28, 2011 4:23 PM (in response to fastroller)Andrew,
Yes, you are right - but Nikhil says that in his case stylesheet is included after datatable.ecss, not before, so they should work. IMHO replacing original stylesheet can be somewhat dangerous keeping in mind that original stylesheet can change between versions - so you'll have to maintain it.
-
5. Re: Precedence of custom ecss over those of frameworks
moldovan Jun 21, 2011 7:35 AM (in response to fastroller)I also have the strange situation, that my own css/ecss - Files are inserted on higher position as the richfaces ones, in the h.head-Section. So my custom properties-file will be taken to style the components, but not my custom css/ecc files - the eccs-files from the richfaces-jar will be taken.
I'm thinking richfaces styles and javascript should be inserted at highest position in the header, but this is not the case.
I cannot use the "workaround", to locate all the css inside org.richfaces folder, which Andrew hat written, because my webapp imports a Skinning-jarfile, which holds different custom skins for several webapps. So in these JAR are a own skin for webapp1, a own skin for webapp2,....
Has anyone the same situation? Or I'm making anything wrong? I only wrote my custom css for different richfaces-components and imported them via h:outputStyleSheet-Tag....
thanks for any answer!
-
6. Re: Precedence of custom ecss over those of frameworks
kwutzke Nov 24, 2011 8:55 AM (in response to moldovan)I am experiencing the same: custom ECSS styles aren't applied at all when placing the h:outputStylesheet into h:head. I honestly consider this a pretty serious bug.
I filed it here: https://issues.jboss.org/browse/RF-11734
Karsten
-
7. Re: Precedence of custom ecss over those of frameworks
bleathem Nov 25, 2011 1:24 PM (in response to kwutzke)A good practice is to place all your <h:outputStylesheet> tags at the bottom of your template/page (they will still be targeted to the html "head"). This way, all components will have there stylesheet resources rendered before the h:outputStylesheet resource is rendered. This is how JSF 2 works at the moment.
If there is enough of a demand, we can look at providing a RichFaces stylesheet component that lets you specify where the resource get's placed. But until such a component is developped, just put your h:outputStylesheet tags at the bottom of your template/page.
-----
Edit: Removed a reference to the _target_ attribute (I was thinking of h:outputScript when I wrote it)