<section role="NotInToc" id="rich_dataGrid">
   <title>
				&lt;
				rich:dataGrid
				&gt;
				<emphasis role="since">
         <superscript> available since <emphasis role="version">3.0.0</emphasis>
         </superscript>
      </emphasis>
   </title>
   <section>
      <title>Description</title>
      <para>The component to render data as a grid that allows choosing data from a model
      and obtains built-in support of Ajax updates.</para>
      <figure>
        <title>
            <emphasis role="bold">
               <property>&lt;rich:dataGrid&gt;</property>
            </emphasis> component</title>
         <mediaobject> 
            <imageobject>
               <imagedata fileref="images/dataGrid_init.png"/>
            </imageobject>
         </mediaobject>
      </figure>
    </section>
   <section>
      <title>Key Features</title> 
      <itemizedlist>
         <listitem>
            <para>A completely skinned table and child elements</para>
         </listitem>
         <listitem>
            <para>Possibility to update a limited set of rows with Ajax</para>
         </listitem>
         <listitem>
            <para>Possibility to receive values dynamically from a model</para>
         </listitem>
      </itemizedlist>  
   </section>
   <section>
      <title>Details of Usage</title>
      <para>The component takes a list from a model and outputs it the same way as with <emphasis role="bold">
            <property>&lt;h:panelGrid&gt;</property>
         </emphasis> for inline data. To define grid properties and styles, use the same definitions as
      for <emphasis role="bold">
            <property>&lt;h:panelGrid&gt;</property>.</emphasis>
      </para>
      <para>The component allows to:</para>
      <itemizedlist>
         <listitem>
            <para>Use <emphasis>
                  <property>"header"</property>
               </emphasis> and <emphasis>
                  <property>"footer"</property>
               </emphasis> facets for output</para>
         </listitem>
         <listitem>
            <para>Limit number of output elements (<emphasis>
                  <property>"elements"</property>
               </emphasis> attribute) and define first element for output (<emphasis>
                  <property>"first"</property>
               </emphasis> attribute)</para>
         </listitem>
         <listitem>
            <para>Bind pages with <emphasis role="bold">
                  <property>&lt;rich:datascroller&gt;</property>
               </emphasis> component</para>
         </listitem>
      </itemizedlist>

      <para>Here is an example:</para>

      <para>
         <emphasis role="bold">Example:</emphasis>
      </para>

      <programlisting role="XML"><![CDATA[...
<rich:panel style="width:150px;height:200px;">
		<h:form>
       			<rich:dataGrid value="#{dataTableScrollerBean.allCars}" var="car" columns="2" elements="4" first="1">
               		<f:facet name="header">
                      		<h:outputText value="Car Store"></h:outputText>
             			</f:facet>
                  		<rich:panel>
                      		<f:facet name="header">
                          			<h:outputText value="#{car.make} #{car.model}"></h:outputText>
                      		</f:facet>
                      		<h:panelGrid columns="2">
                           			<h:outputText value="Price:" styleClass="label"></h:outputText>
                           			<h:outputText value="#{car.price}"/>
                           			<h:outputText value="Mileage:" styleClass="label"></h:outputText>
                           			<h:outputText value="#{car.mileage}"/>
                      		</h:panelGrid>
                  		</rich:panel>
                  		<f:facet name="footer">
                      		<rich:datascroller></rich:datascroller>
                  		</f:facet>
              	</rich:dataGrid>
		</h:form>
</rich:panel>		
...
]]></programlisting>
      <para>This is a result:</para>

      <figure>
         <title>Component usage</title>
         <mediaobject>
            <imageobject>
               <imagedata fileref="images/dataGrid2.png"/>
            </imageobject>
         </mediaobject>
      </figure>

      <para>The component was created basing on the <emphasis role="bold">
            <property>&lt;a4j:repeat&gt;</property>
         </emphasis> component and as a result it could be partially updated with Ajax. <emphasis>
            <property>"ajaxKeys"</property>
         </emphasis> attribute allows to define row keys that are updated after an Ajax request.</para>
      <para>Here is an example:</para>

      <para>
         <emphasis role="bold">Example:</emphasis>
      </para>
      <programlisting role="XML"><![CDATA[...
<rich:dataGrid value="#{dataTableScrollerBean.allCars}" var="car" ajaxKeys="#{listBean.list}" 
                        binding="#{listBean.dataGrid}" id="grid" elements="4" columns="2">
		...
</rich:dataGrid>
...
<a4j:commandButton action="#{listBean.action}" reRender="grid" value="Submit"/>
...]]></programlisting>

      <para> In the example <emphasis>
            <property>"reRender"</property>
         </emphasis> attribute contains value of <emphasis>
            <property>"id"</property>
         </emphasis> attribute for <emphasis role="bold">
            <property>&lt;rich:dataGrid&gt;</property>
         </emphasis> component. As a result the component is updated after an Ajax request.</para>
  </section>
   <section>
      <title>Reference Data</title>
      <para>
         <ulink url="&tlddoc;rich/dataGrid.html">Table of 
							&lt;rich:dataGrid&gt; 
							 attributes</ulink>.
						</para>
      <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.DataGrid</entry>
               </row>
               <row>
                  <entry>component-class</entry>
                  <entry>org.richfaces.component.html.HtmlDataGrid</entry>
               </row>
               <row>
                  <entry>component-family</entry>
                  <entry>org.richfaces.DataGrid</entry>
               </row>
               <row>
                  <entry>renderer-type</entry>
                  <entry>org.richfaces.DataGridRenderer</entry>
               </row>
               <row>
                  <entry>tag-class</entry>
                  <entry>org.richfaces.taglib.DataGridTag</entry>
               </row>
            </tbody>
         </tgroup>
      </table>
      <table>
         <title>Facets</title>
         <tgroup cols="2">
            <thead>
               <row>
                  <entry>Facet name</entry>
                  <entry>Description</entry>
               </row>
            </thead>
            <tbody>
               <row>
                  <entry>header</entry>
                  <entry>Defines the header content</entry>
               </row>
               <row>
                  <entry>footer</entry>
                  <entry>Defines the footer content</entry>
               </row>
               <row>
                  <entry>caption</entry>
                  <entry>Defines the caption content</entry>
               </row>
            </tbody>
         </tgroup>
      </table>
   	<para>Custom style classes as well as skin parameters for  <emphasis role="bold">
   		<property>&lt;rich:dataGrid&gt;</property></emphasis> are the same as for the  <link linkend="dataTableRefData"><emphasis role="bold">
   			<property>&lt;rich:dataTable&gt;</property></emphasis> component.</link></para>
	<para>You can find all necessary information about style classes redefinition in 
						<link linkend="customstyles">Definition of Custom Style Classes</link> 
							section.</para>
						</section>
   <section>
      <title>Relevant Resources Links</title>
      <para>
         <ulink url="http://livedemo.exadel.com/richfaces-demo/richfaces/dataGrid.jsf?c=dataGrid">On the component LiveDemo page</ulink> you can see the example of <emphasis role="bold">
            <property>&lt;rich:dataGrid&gt;</property>
         </emphasis> usage and sources for the given example. </para>
  </section>
</section>
