<?xml version='1.0' encoding='UTF-8'?>
<section>
<sectioninfo>
<keywordset>
<keyword>rich:subtable</keyword>
<keyword>HtmlSubTable</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.SubTable</entry>
          </row>
          <row>
            <entry>component-class</entry>
            <entry>org.richfaces.component.html.HtmlSubTable</entry>
          </row>
          <row>
            <entry>component-family</entry>
            <entry>org.richfaces.SubTable</entry>
          </row>
          <row>
            <entry>renderer-type</entry>
            <entry>org.richfaces.SubTableRenderer</entry>
		  </row>
		  <row>
			<entry>tag-class</entry>
            <entry>org.richfaces.taglib.SubTableTag</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:dataTable value="#{capitalsBean.capitals}" var="capitals">
        <!--...//Set of columns and header/footer facets-->
        <rich:subTable value=#{capitals.details} var="detail">
            <!--...//Set of columns and header/footer facets-->
        </rich:subTable>
    </rich:dataTable>
...
]]></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.HtmlSubTable;
...
HtmlSubTable mySubTable = new HtmlSubTable();
...
]]></programlisting>
  </section>
  <section>
    <title>Details of Usage</title>
	<para>The <property>subtable</property> component is very similar to the custom JSF dataTable one, the only difference is that
	 the component doesn&apos;t add the wrapping <emphasis role="bold"><property>&lt;table&gt;</property></emphasis> and <emphasis role="bold"><property>&lt;tbody&gt;</property></emphasis> tags. 
	 Hence, it&apos;s possible to add a subtable structure different from the main one to organize tables
	  of the master - details type. The component is also has common peculiarities of any rich component:</para>
	   <itemizedlist>
	   <listitem>Skin support. The table completely meets a three-class principle of Rich Faces skinnability</listitem>
	   <listitem>Support of Ajax updates for a limited set of rows</listitem>
	   </itemizedlist>
    <para>Skins support is described in the <link linkend="ArchitectureOverview">corresponding section</link>. Ajax support is
	    possible because the component is created basing on the <emphasis role="bold"><property>&lt;a4j:repeat&gt;</property></emphasis> component and as a result the 
	    component has its possibilities of Ajax updates for a limited set of rows. The component is implemented
	     with the <emphasis ><property>&quot;ajaxKeys&quot;</property></emphasis> attribute for a table and in contrast to the <emphasis role="bold"><property>&lt;a4j:repeat&gt;</property></emphasis> outputs the standard HTML 
	     structure for table rendering.</para>
	     <programlisting role="XML"><![CDATA[...
    <rich:dataTable value="#{capitalsBean.capitals}" var="capitals" id="table">
        <!--...//Set of columns and header/footer facets-->
        <rich:subTable value="#{capitals.details}" var="detail" ajaxKeys="#{bean.ajaxSet}" binding="#{bean.subtable}" >
            <!--...//Set of columns and header/footer facets-->
        </rich:subTable>
    </rich:dataTable>
...
    <a4j:commandButton action="#{bean.someAction}" reRender="table"/>
...
]]></programlisting>
<para>For such a table during someAction processing called with Ajax request when the key is pressed
 it&apos;s possible to fill in lot&apos;s of ajaxKeys with strings indices that are to be updated. 
 A resulting output on the client contains only required rows and they are updated in the tree, even 
 when update is specified for the whole table.</para>
      </section>
    <section>
    <title>Look-and-Feel Customization</title>
    <para>For skinnability implementation, the components use a <emphasis 
><property>style class redefinition method</property></emphasis>.</para>
    <para>Default style classes are mapped on <emphasis 
><property>skin parameters</property>.</emphasis></para>
	<para>To redefine appearance of all subTables 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 subTable to your page style sheets</listitem>
         </itemizedlist>
	<para>To redefine a style of a particular page, use component class attributes which list is the same as the <property>subTable</property> one and is known to you.</para>
    </section>
  <section>
    <title>Definition of Custom Style Classes</title>
    
    <table>
      <title>Classes names that define a subtable appearance</title>
      <tgroup cols="2">
        <thead>
          <row>
            <entry>Class name</entry>
            <entry>Description</entry>
          </row>
        </thead>
        <tbody>
          <row>
            <entry>rich-subtable</entry>
            <entry>Defines styles for all subtable</entry>
          </row>
          <row>
            <entry>rich-subtable-caption</entry>
            <entry>Defines styles for a &quot;caption&quot; facet element</entry>
          </row>
          <row>
            <entry>rich-subtable-header</entry>
            <entry>Defines styles for a subtable header row</entry>
          </row>
          <row>
            <entry>rich-subtable-headercell</entry>
            <entry>Defines styles for a subtable header cell</entry>
          </row>
          <row>
            <entry>rich-subtable-header-continue</entry>
            <entry>Defines styles for all subtable header lines after the first</entry>
          </row>
          <row>
            <entry>rich-subtable-subheader</entry>
            <entry>Defines styles for a column header of subtable</entry>
          </row>
          <row>
            <entry>rich-subtable-subheadercell</entry>
            <entry>Defines styles for a column header cell of subtable</entry>
          </row>
          <row>
            <entry>rich-subtable-cell</entry>
            <entry>Defines styles for a subtable cell</entry>
          </row>
          <row>
            <entry>rich-subtable-row</entry>
            <entry>Defines styles for a subtable row</entry>
          </row>
          <row>
            <entry>rich-subtable-firstrow</entry>
            <entry>Defines styles for a subtable start row</entry>
          </row>
          <row>
            <entry>rich-subtable-subfooter</entry>
            <entry>Defines styles for a column footer of subtable</entry>
          </row>
          <row>
            <entry>rich-subtable-subfootercell</entry>
            <entry>Defines styles for a column footer cell of subtable</entry>
          </row>
          <row>
            <entry>rich-subtable-footer</entry>
            <entry>Defines styles for a subtable footer row</entry>
          </row>
          <row>
            <entry>rich-subtable-footercell</entry>
            <entry>Defines styles for a subtable footer cell</entry>
          </row>
          <row>
            <entry>rich-subtable-footer-continue</entry>
            <entry>Defines styles for all subtable footer lines after the first</entry>
          </row>
        </tbody>
      </tgroup>
    </table>
    <para>In order to redefine styles for all <emphasis role="bold">
      <property>&lt;rich:subTable&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:subTable&gt;</property>
    </emphasis> components, define your own style classes in the corresponding <emphasis
      role="bold">
      <property>&lt;rich:subTable&gt;</property>
    </emphasis>attributes.</para>
  </section>
</section>