<?xml version='1.0' encoding='UTF-8'?>
<section>
<sectioninfo>
<keywordset>
<keyword>rich:tab</keyword>
<keyword>HtmlTab</keyword>
</keywordset>
</sectioninfo>
  
     <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.richfaces.Tab</entry>
          </row>
          <row>
            <entry>component-class</entry>
            <entry>org.richfaces.component.html.HtmlTab</entry>
          </row>
          <row>
            <entry>component-family</entry>
            <entry>org.richfaces.Tab</entry>
          </row>
          <row>
            <entry>renderer-type</entry>
            <entry>org.richfaces.TabRenderer</entry>
		  </row>
		  <row>
			<entry>tag-class</entry>
            <entry>org.richfaces.taglib.TabTag</entry>
          </row>
        </tbody>
      </tgroup>
    </table>
  
  <section>
    <title>Creating the Component with a Page Tag</title>
    <para>Here is a simple example as it could be used on a page: </para>

    <para>
      <emphasis role="bold">Example:</emphasis>
    </para>
    <programlisting role="XML"><![CDATA[...
    <rich:tabPanel>
        <!--Set of Tabs inside-->
            <rich:tab>
                ...
            </rich:tab>
    </rich:tabPanel>
...
]]></programlisting>
  </section>
  <section>
    <title>Creating the Component Dynamically Using Java</title>

    <para>
      <emphasis role="bold">Example:</emphasis>
    </para>
    <programlisting role="JAVA"><![CDATA[import org.richfaces.component.html.HtmlTab;
...	
HtmlTab myTab = new HtmlTab();
...
]]></programlisting>
  </section>
  <section>
    <title>Details of Usage</title>
    <para>The main component function is to define a content group that is rendered and processed when the <property>tab</property> is active, i.e. click on a <property>tab</property> causes switching onto a <property>tab</property> containing content corresponded to this <property>tab</property>.</para>
    <para>The <emphasis ><property>&quot;label&quot;</property></emphasis > attribute defines text to be represented. If you can use the
      <emphasis ><property>&quot;label&quot;</property></emphasis > facet, you can even not use the <emphasis ><property>&quot;label&quot;</property></emphasis > attribute.</para>
    <emphasis role="bold">Example:</emphasis>
    <programlisting role="XML"><![CDATA[...
    <rich:tab>
        <f:facet name="label">  
            <h:graphicImage value="/images/img1.gif"/>
        </f:facet>
        ...
        <!--Any Content inside-->
        ...
    </rich:tab>
...
]]></programlisting>

    <para>A marker on a <property>tab</property> header defined with the <emphasis ><property>&quot;label&quot;</property></emphasis> attribute. Moreover, each <property>tab</property> could be disabled (switching on this <property>tab</property> is impossible) with the <emphasis ><property>&quot;disable&quot;</property></emphasis> attribute.</para>

    <para>
      <emphasis role="bold">Example:</emphasis>
    </para>
    <programlisting role="XML"><![CDATA[...
    <rich:tabPanel width="20%"> 
        <rich:tab label="Tab">
            <h:outputText value="Active Tab content"/>
        </rich:tab>
        <rich:tab label="Disabled Tab" disabled="true">
            ...
        </rich:tab>
        <rich:tab label="Next Enabled Tab">
            ...
        </rich:tab>
    </rich:tabPanel>
...]]></programlisting>
<para>With this example it&apos;s possible to generate the <property>tab panel</property>
 with the second disabled and two active <property>tabs</property> (see the picture).</para>
<figure>
  <title>Tab Panel with disabled tab</title>
<mediaobject> 
        <imageobject>
            <imagedata fileref="images/tab2.gif"/>
        </imageobject>
</mediaobject>
  </figure>
<para>Switching mode could be defined not only for the whole panel <property>tab</property>, but also 
for each particular <property>tab</property>, i.e. switching onto one <property>tab</property> could be
 performed right on the client with the corresponding JavaScript and onto another 
 <property>tab</property> with an Ajax request on the server. <property>Tab</property> switching modes
  are the same as <property>tabPanel</property> ones.</para>
<para>Each <property>tab</property> also has an attribute name (alias for <emphasis ><property>&quot;id&quot;</property></emphasis> attribute). Using this attribute value it&apos;s possible e.g. to set an active <property>tab</property> on a model level specifying this name in the corresponding attribute of the whole <property>tab</property>.</para>
<para>Except the specific component attributes it has all necessary attributes for JavaScript event definition.</para>
<itemizedlist>
        <listitem>
          onmouseover
        </listitem>
        <listitem>
          onmouseout
        </listitem>
		<listitem>
		  etc.
		</listitem>
</itemizedlist>
    <para>
      Some event could be performed on the tab which has been entered/left using &quot;ontabenter&quot;/&quot;ontableave&quot; attributes. See the example below.</para>

    <para>
      <emphasis role="bold">Example:</emphasis>
    </para>
    <programlisting role="XML"><![CDATA[...
    <rich:tabPanel>
        <rich:tab label="Tab1" ontabenter="alert()">
            ...
        </rich:tab>
        ...
    </rich:tabPanel>
...]]></programlisting>
    <para>
      The following example shows how on the client side to get the names of entered/left tabs.
    </para>
    <programlisting role="JAVA"><![CDATA[ontabenter="alert(leftTabName)"]]></programlisting>
    </section>
    <section>
    <title>Look-and-Feel Customization</title>
    <para>For skinnability implementation the components use <emphasis 

><property>style class redefinition method</property>.</emphasis> 
Default style classes are mapped on <emphasis 

><property>skin parameters</property>.</emphasis></para>
	<note><title>Note:</title>
	A panel appearance and content is defined with a <property>tab</property> panel i.e. on the <property>tab</property> level it&apos;s possible to define only an appearance of this <property>tab</property> header. 
	</note>
	<para>To redefine appearance of all tabs at once, there are two ways:</para>
        <itemizedlist>
        <listitem>to redefine corresponding skin parameters</listitem>
        <listitem>to add <emphasis 
><property>style classes</property></emphasis> used by the tab to your page style sheets</listitem>
         </itemizedlist>
	  
</section>
    <section>
    <title>Definition of Custom Style Classes</title>
      
      <table>
        <title>Classes names that define a tab</title>
        <tgroup cols="2">
          <thead>
            <row>
              <entry>Class name</entry>
              <entry>Description</entry>
            </row>
          </thead>
          <tbody>
            <row>
              <entry>rich-tab-header</entry>
              <entry>Defines styles for a tab header</entry>
            </row>
          </tbody>
        </tgroup>
      </table>
      <table>
        <title>Classes names that define a tab states</title>
        <tgroup cols="2">
          <thead>
            <row>
              <entry>Class name</entry>
              <entry>Description</entry>
            </row>
          </thead>
          <tbody>
            <row>
              <entry>rich-tab-active</entry>
              <entry>Defines styles for an active tab</entry>
            </row>
            <row>
              <entry>rich-tab-inactive</entry>
              <entry>Defines styles for an inactive tab</entry>
            </row>
            <row>
              <entry>rich-tab-disabled</entry>
              <entry>Defines styles for a disabled tab</entry>
            </row>
          </tbody>
        </tgroup>
      </table>
      <para>In order to redefine styles for all <emphasis role="bold">
        <property>&lt;rich:tab&gt;</property>
      </emphasis> components on a page using CSS, it&apos;s enough to create classes with the
        same names and define necessary properties in them.</para>
      
      <para>To change styles of particular <emphasis role="bold">
        <property>&lt;rich:tab&gt;</property>
      </emphasis> components define your own style classes in the corresponding <emphasis
        role="bold">
        <property>&lt;rich:tab&gt;</property>
      </emphasis>attribute.</para>
	</section>
</section>