1 Reply Latest reply on Apr 2, 2012 8:47 AM by nodeny

    Richfaces 3.3.x - rich:editor - Is there a way to specify a .xcss instead of a .css with param "content_css"

    nodeny

      Hi,

       

      In my case I load in an xhtml template the following xcss :

           <a4j:loadStyle src="resource:///company/ng/ui/style/theme/website.xcss" />

       

       

      In this xhtml I use a rich:editor.
      I want my rich:editor to use the css properties generated by the "website.xcss" .

       

      Is there a way to load my .xcss with the "content_css" param, like :

       

      <rich:editor [...]>

                      <f:param name="content_css" value=".../website.xcss"/>

                .....

        </rich:editor>

       

       

      Or is it possible to retrieve the generated url from the <a4j:loadStyle ... /> with java and to include it in like this way <f:param name="content_css" value="#{myManager.xcssUrl}"/> ?

       

      Or is there another solution ?

       

      Thank you in advance !

        • 1. Re: Richfaces 3.3.x - rich:editor - Is there a way to specify a .xcss instead of a .css with param "content_css"
          nodeny

          Ok, I found a way to manage it :

           

          > 1. I retrieve the resource url with a bean :

           

          public String getResourceUrl(String resource) {

                                   ViewHandler viewHandler = FacesContext.getCurrentInstance().getApplication().getViewHandler();

                                   return viewHandler.getResourceURL(FacesContext.getCurrentInstance(), resource);

          }

           

           

          > 2 . I include it with the "content_css" param :

           

          <rich:editor [...]>

               <f:param name="content_css" value="#{myBean.getResourceUrl('resource:///ng/ui/style/theme/myFile.xcss')}"/>

                    .....

            </rich:editor>

           

           

           

          > 3. Enjoy