<?xml version='1.0' encoding='UTF-8'?>
<chapter>
  
     <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.Form</entry>
          </row>
          <row>
            <entry>component-family</entry>
            <entry>javax.faces.Form</entry>
          </row>
          <row>
            <entry>component-class</entry>
            <entry>org.ajax4jsf.component.html.AjaxForm</entry>
          </row>
          <row>
            <entry>renderer-type</entry>
            <entry>org.ajax4jsf.FormRenderer</entry>
          </row>
        </tbody>
      </tgroup>
    </table>
  
  <section>
    <title>Creating on a page</title>
    <para>Component definition on a page is similar to definition of the original component from JSF HTML library. </para>
    <programlisting role="XML"><![CDATA[<a4j:form>
	<!--...Some content to be submitted.-->
</a4j:form>
]]></programlisting>
  </section>
  <section>
    <title>Dynamical creation of a component from Java code</title>

  <para>
      <emphasis role="bold">Example:</emphasis>
 </para>
    <programlisting role="JAVA"><![CDATA[import org.ajax4jsf.component.html.AjaxForm;
...
AjaxForm myForm = new AjaxForm();
...]]></programlisting>
  </section>
  <section>
    <title>Key attributes and ways of usage</title>
    <para>The difference with the original component is that all hidden fields required for command links are always rendered and it doesn't depend on links rendering on the initial page. It solves the problem with invalid links that weren't rendered on a page immediately, but after some Ajax request.</para>
    <para>Beginning with release 1.0.5 additional attributes that make this form variant universal have appeared. With a new attribute definition as ajax=<emphasis >
        <property>&quot;true&quot;</property>
      </emphasis>, it becomes possible to set Ajax submission way for any components inside, i.e. not a page URL is used as an <emphasis >
        <property>&quot;action&quot;</property>
      </emphasis> attribute, but the javascript:A4J.AJAX.Submit(...) call. In this case, rendering is defined as &quot;reRender&quot;=list of Ids for the form element itself.</para>
	<para>Example</para>
	<programlisting role="XML"><![CDATA[<a4j:form id="helloForm" ajaxSubmit="true" reRender="table">
	...
	<t:dataTable id="table"... >
		...
	</t:dataTable>
	...
	<t:dataScroller for="table"... >
		...
	</t:dataScroller>
	...
</a4j:form
]]></programlisting>
<para>This example shows that in order to make  <emphasis role="bold">
        <property>&lt;t:dataScroller&gt;</property>
      </emphasis> submissions to be Ajax ones it's required only to place this <emphasis role="bold">
        <property>&lt;t:dataScroller&gt;</property>
      </emphasis> into <emphasis role="bold">
        <property>&lt;a4j:form&gt;</property>
      </emphasis>. In the other case it is necessary to redefine renders for its child links elements that are defined as <emphasis role="bold">
        <property>&lt;h:commandLink&gt;</property>
      </emphasis> and can't be made Ajax ones with using e.g. <emphasis role="bold">
        <property>&lt;a4j:support&gt;</property>
      </emphasis>.</para>
  </section>
  <section>
    <title>Relevant resources links</title>
	<para>
	  <ulink url="http://livedemo.exadel.com/richfaces-demo/richfaces/form.jsf?c=form">Here.</ulink>
	  you can see the example of <emphasis role="bold"
	    ><property>&lt;a4j:form&gt;</property></emphasis> usage and sources for the given example.	
	</para>
  </section>  
</chapter>
