6 Replies Latest reply on May 16, 2008 12:09 PM by Olivier Martin

    a4j:loadStyle problems with xcss file

    David Reed Newbie

      I have taken a modified version of the sample on the Exadel livedemo site for a4j:loadStyle when using an xcss file. Unfortunately it is not working for me.

      I am using the following:

      JBoss 4.2.2 GA
      JBoss Seam 2.1.0 Snapshot
      JBoss RichFaces 3.2.0
      JSF RI 1.2
      Facelets 1.1.14

      When I use a line like the following in my xhtml file it does not get processed. Or at least its contents are never put out to the browser.

      <a4j:loadStyle src="/stylesheet/ecsc.xcss" />

      Of course I have had no luck at trying to find any documentation on this XML formated CSS file and how to use it either.

      Is there something I am missing? Did wrong?

      Also, where can I find documentation on the structure of the xcss file?


        • 1. Re: a4j:loadStyle problems with xcss file
          Sergey Smirnov Master

          Most likely you miss the resource:// prefix that presents in the example you referenced to.


          <a4j:loadStyle src="resource:///stylesheet/ecsc.xcss" />

          If does not work, post the content of this xcss

          • 2. Re: a4j:loadStyle problems with xcss file
            David Reed Newbie

            Never mind. I finally figured it out after looking at the download of the demo war.

            I was missing the resource:// in the front of the src attribute. I had mistakenly thought that the demo was trying to pull it out of a JAR when I just had my xcss file in a sibling directory.

            Documentation would still be VERY usefull though...


            • 3. Re: a4j:loadStyle problems with xcss file
              David Reed Newbie


              Thanks. That's what I found and it does work now.

              Is there any documentation on the structure of these xcss files? A schema (XSD) file?

              The reason why I ask is because while this takes care of my need to reuse skin parameters in other CSS entries, I was wondering if it could also take care of another need/desire. What would be great, is if it could handle the case where one style entry could incorporate one or more other entries without having to redo the others. Basically building upon another entry.

              This would cut down on the size of my css/xcss file along with using multiple entries in the styleClass attributes (or similar ones).


              • 4. Re: a4j:loadStyle problems with xcss file
                Sergey Smirnov Master

                XCSS format doc is missing along with other doc on RichFaces CDK. Originally, it was just for internal use with no outside access.

                With 3.2.1, we are going to introduce "Skin Addon" feature, where xcss will be used. So, the doc is coming.

                In the further releases, we are going to use EL and EL function instead of xcss selectors. So, most likely, the pure css format will be used.

                However, the question about extending this feature for reusing not only skin properties, but other css artifacts is very arguable.

                First, because it make your css less standardized. Second, the css is inexhaustible just as atom. So, such feature requires a lot of resources to implement and support.

                • 5. Re: a4j:loadStyle problems with xcss file
                  David Reed Newbie

                  Thanks! I am already looking forward to 3.2.1 for other fixes too anyways.

                  Personally I don't think I would need to extend it, but using EL and going to CSS (dropping the XCSS) would be great to me.

                  Thanks again!

                  • 6. Re: a4j:loadStyle problems with xcss file
                    Olivier Martin Newbie

                    Is the resource:// prefix mandatory ?

                    I'd like to link to the stylesheet manually and have the control of the URL because of the firewall that is very restrictive.

                    URLs like those are kind of rejected :