0 Replies Latest reply on Sep 12, 2007 10:47 AM by Yannick Lazzari

    aj4:loadStyle and aj4:loadScript insertion order problem

    Yannick Lazzari Newbie

      Hi,

      I have a problem with the order in which scripts and styles are added in the HTML when you load them using a4j:loadStyle and a4j:loadScript. Actually it might be more related to the way RichFaces integrated this feature but I'm not sure so here it is anyways.

      Let's say I have a template in which I include my own css file that overrides some of the styles defined by some RichFaces component that I use in my template. I use the a4j:loadStyle to load my style sheet but then after that, as the template gets parsed, I guess RichFaces realizes that a component requires a certain css file that hasn't been included in the page yet, so it appends it somewhere in the "head" tag of the output HTML. The problem is that it adds it AFTER my own style sheet, so none of my style override take effect. I think that when these components decide to add a style sheet that wasn't explicitly included in the page, it should be added BEFORE the ones that were explicitly included so that we can actually override them. I think the same logic should apply to javascript files as well.

      Is this the right place to ask this? If not, I will move my post to the RichFaces forum.

      Thank you.