<?xml version="1.0" encoding="UTF-8"?>
<chapter>
  <chapterinfo>
    <keywordset>
      <keyword>a4j:loadStyle</keyword>
    </keywordset>
  </chapterinfo>
     <table>
	  <title>Component identification parameters </title>
      <tgroup cols="2">
	  <thead>
            <row>
                  <entry>Name</entry>
                  <entry>Value</entry>
            </row>
        </thead>
        <tbody>
          <row>
            <entry>component-type</entry>
            <entry>org.ajax4jsf.LoadStyle</entry>
          </row>
          <row>
            <entry>component-family</entry>
            <entry>org.ajax4jsf.LoadStyle</entry>
          </row>
          <row>
            <entry>component-class</entry>
            <entry>org.ajax4jsf.component.html.HtmlLoadStyle</entry>
          </row>
          <row>
            <entry>renderer-type</entry>
            <entry>org.ajax4jsf.LoadStyleRenderer</entry>
          </row>
        </tbody>
      </tgroup>
    </table>
  
  <section>
    <title>Creating on a page</title>
    <para>To create the simplest variant on a page use the following syntax:</para>

  <para>
      <emphasis role="bold">Example:</emphasis>
 </para>
    <programlisting role="XML"><![CDATA[<a4j:loadStyle src="styles/style.css"/>
]]></programlisting>
  </section>
  <section>
    <title>Creating the Component Dynamically Using Java</title>

  <para>
      <emphasis role="bold">Example:</emphasis>
 </para>
    <programlisting role="JAVA"><![CDATA[import org.ajax4jsf.component.html.HtmlLoadStyle;
...
HtmlLoadScript myStyle = new HtmlLoadStyle();
...
]]></programlisting>
  </section>
  <section>
    <title>Key attributes and ways of usage</title>
    <para>
      As it was mentioned <link linkend="loadStyle">above</link> this component returns its value as the value of 
      the <emphasis><property>&quot;src&quot;</property></emphasis> attribute passing it to the
    	 <code>getResourceURL()</code> method of the ViewHandler for this application, and passing 
    	 the result	via the <code>encodeResourceURL()</code> method of the ExternalContext.
    </para>
    <para>
    	It means that the Context is inserted automatically to the link. And calls
    	 like <code>resource://</code> is properly handled.
    </para>
    <para>
    	Except this - you may be free to put your stylesheet links right from the child 
    	page while using <property>facelets templates</property>.
    </para>
</section>
  <section>
    <title>Relevant resources links</title>
    <para>
      Some additional information about usage of component can be found 
      <ulink url="http://livedemo.exadel.com/richfaces-demo/richfaces/style.jsf?c=loadStyle">on the component Live Demo page</ulink>.
    </para>
  </section>
  
</chapter>   