<?xml version="1.0" encoding="UTF-8"?>
<chapter>
  <chapterinfo>
    <keywordset>
      <keyword>a4j:loadBundle</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.Bundle</entry>
          </row>
          <row>
            <entry>component-family</entry>
            <entry>org.ajax4jsf.Bundle</entry>
          </row>
          <row>
            <entry>component-class</entry>
            <entry>org.ajax4jsf.component.html.AjaxLoadBundle</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:loadBundle baseName="demo.bundle.Messages" var="Message"/>]]></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.AjaxLoadBundle;
...
AjaxLoadBundle myBundle = new AjaxLoadBundle();
...
		]]></programlisting>
	
  </section>

  <section>
    <title>Key attributes and ways of usage</title>
	<para>

	<emphasis role="bold"><property>&lt;a4j:loadBundle&gt;</property>
	</emphasis>allows to use reference to bundle messages during the Ajax re-rendering. 
<emphasis role="bold"><property>&lt;a4j:loadBundle&gt;</property>
	</emphasis> is a substitute for the
<emphasis role="bold"><property>&lt;f:loadBundle&gt;</property>
	</emphasis> in JSF 1.1 which is not a JSF component originally. 

<emphasis role="bold"><property>&lt;f:loadBundle&gt;</property>
	</emphasis>	 is a jsp tag that load the bundle messages into the request scope when page is rendered. As soon as each Ajax request
works in own request scope, the bundles loaded with 
<emphasis role="bold"><property>&lt;f:loadBundle&gt;</property>
	</emphasis> are unavailable. 
Instead of 
<emphasis role="bold"><property>&lt;f:loadBundle&gt;</property>
	</emphasis> that might be located anywhere on a page, the 

	<emphasis role="bold"><property>&lt;a4j:loadBundle&gt;</property>
	</emphasis> should be declared inside the  

	<emphasis role="bold"><property>&lt;f:view&gt;</property>
	</emphasis>	(this does not matter in case on using Facelets) 
JSF 1.2 introduces the bundle registered in the faces-config.xml. This fixed the problem with 
	<emphasis role="bold"><property>&lt;f:loadBundle&gt;</property>
	</emphasis>. 
Therefore, you can use this JSF 1.2 way to declare your bundles. 

	</para>
  </section>
  <section>
    <title>Relevant resources links</title>
	<para>
	  <ulink url="http://livedemo.exadel.com/richfaces-demo/richfaces/bundle.jsf?c=loadBundle">Here</ulink> you can found some additional information for <emphasis role="bold"
	    ><property>&lt;a4j:loadBundle&gt;</property></emphasis> component usage.
	</para>
    <para>
      <ulink url="http://java.sun.com/javaee/javaserverfaces/1.1_01/docs/tlddocs/f/loadBundle.html">Here</ulink> you can found some additional information about <emphasis role="bold"><property>&lt;f:loadBundle&gt;</property></emphasis> component.
    </para>
    <para>
      <ulink url="http://java.sun.com/javaee/javaserverfaces/1.1_01/docs/tlddocs/f/view.html">Here</ulink> you can found some additional information about <emphasis role="bold"><property>&lt;f:view&gt;</property></emphasis> component.
    </para>
  </section>  
</chapter>   