<?xml version='1.0' encoding='UTF-8'?>
<section>
  <sectioninfo>
    <keywordset>
      <keyword>unput field</keyword>
      <keyword>rich:inputNumberSpinner</keyword>
      <keyword>HtmlInputNumberSpinner</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.InputNumberSpinner</entry>
        </row>
        <row>
          <entry>component-class</entry>
          <entry>org.richfaces.component.html.HtmlInputNumberSpinner</entry>
        </row>
        <row>
          <entry>component-family</entry>
          <entry>org.richfaces.inputNumberSpinner</entry>
        </row>
        <row>
          <entry>renderer-type</entry>
          <entry>org.richfaces.InputNumberSpinnerRenderer</entry>
        </row>
        <row>
          <entry>tag-class</entry>
          <entry>org.richfaces.taglib.InputNumberSpinnerTag</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:inputNumberSpinner minValue="0" maxValue="100" step="1"/>	
...
]]></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.HtmlInputNumberSpinner;
...
HtmlInputNumberSpinner mySpinner = new HtmlInputNumberSpinner ();
...
]]></programlisting>
  </section>
  <section>
    <title>Details of Usage</title>
    <para><emphasis role="bold">
        <property>&lt;rich:inputNumberSpinner&gt;</property>
      </emphasis> is used to facilitate your data input with rich UI Controls.</para>
    <para>Here is the simplest variant of <property>spinner</property> definition with
          <emphasis><property>&quot;minValue&quot;</property>,</emphasis>
      <emphasis>
        <property>&quot;maxValue&quot;</property>
      </emphasis> and <emphasis>
        <property>&quot;step&quot;</property>
      </emphasis> (on default = &quot;1&quot;) attributes, which define the beginning and
      the end of numerical area and a <property>spinner</property> step.</para>
    <para>
      <emphasis role="bold">Example:</emphasis>
    </para>
    <programlisting role="XML"><![CDATA[...
    <rich:inputNumberSpinner minValue="1" maxValue="100"/>
...
]]></programlisting>
    <para>It generates on a page:</para>
    <figure>
      <title>Generated inputNumberSpinner</title>
      <mediaobject>
        <imageobject>
          <imagedata fileref="images/inputNumberSpinner2.gif"/>
        </imageobject>
      </mediaobject>
    </figure>
    <para>There are also several attributes to define functionality peculiarities:</para>
    <itemizedlist>
      <listitem>
        <emphasis>
          <property>&quot;cycled&quot;</property>
        </emphasis> if the attribute is <emphasis><property>&quot;true&quot;</property></emphasis> after the current value reaches the
        border value it's be reversed to another border value after next increasing/decreasing. In
        other case possibilities of next increasing/decreasing are locked </listitem>
      <listitem>
        <emphasis>
          <property>&quot;disabled&quot;</property>
        </emphasis> is an attribute that defines whether a component is active on a page </listitem>
      <listitem>
        <emphasis>
          <property>&quot;manualInput&quot;</property>
        </emphasis> is an attribute that defines whether a keyboard input is possible or only UI
        controls could be used</listitem>
    </itemizedlist>
    <para>Moreover, to add e.g. some JavaScript effects, events defined on it are used</para>
    <itemizedlist>
      <listitem> onchange </listitem>
      <listitem> onmouseover </listitem>
      <listitem> onclick </listitem>
      <listitem> onfocus </listitem>
      <listitem> onmouseout </listitem>
      <listitem> etc. </listitem>
    </itemizedlist>

  </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 inputNumberSpinners 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 inputNumberSpinner to your page style sheets</listitem>
    </itemizedlist>
    <table>
      <title>Skin parameters redefinition:</title>
      <tgroup cols="2">
        <thead>
          <row>
            <entry>Skin parameters for a container</entry>
            <entry>CSS properties</entry>
          </row>
        </thead>
        <tbody>
          <row>
            <entry>controlBorderColor</entry>
            <entry>border-right-color, border-bottom-color</entry>
          </row>
        </tbody>
      </tgroup>
    </table>
    <table>
      <title>Parameters for an entry field element:</title>
      <tgroup cols="2">
        <thead>
          <row>
            <entry>Skin parameters</entry>
            <entry>CSS properties</entry>
          </row>
        </thead>
        <tbody>
          <row>
            <entry>preferableDataSizeFont</entry>
            <entry>font-size</entry>
          </row>
          <row>
            <entry>preferableDataFamilyFont</entry>
            <entry>font-family</entry>
          </row>
        </tbody>
      </tgroup>
    </table>
    <table>
      <title>Parameters for buttons</title>
      <tgroup cols="2">
        <thead>
          <row>
            <entry>Skin parameters</entry>
            <entry>CSS properties</entry>
          </row>
        </thead>
        <tbody>
          <row>
            <entry>headerBackgroundColor</entry>
            <entry>background-color</entry>
          </row>
        </tbody>
      </tgroup>
    </table>
  </section>
  <section>
    <title>Definition custom style classes</title>
    <figure>
      <title>Custom style classes of inputNumberSpinner</title>
      <mediaobject>
        <imageobject>
          <imagedata fileref="images/inputNumberSpinner3.gif"/>
        </imageobject>
      </mediaobject>
    </figure>
    <para>On the screenshot, there are classes names that define specified elements.</para>
    <table>
      <title>Predefined component skin class</title>
      <tgroup cols="2">
        <thead>
          <row>
            <entry>Class name</entry>
            <entry>Component Element</entry>
          </row>
        </thead>
        <tbody>
          <row>
            <entry>rich-spinner-input-container</entry>
            <entry>a container for input and <emphasis><property>&quot;inside&quot;</property></emphasis> buttons</entry>
          </row>
          <row>
            <entry>rich-spinner-input</entry>
            <entry>text field</entry>
          </row>
          <row>
            <entry>rich-spinner-button-up</entry>
            <entry>a button for value increasing</entry>
          </row>
          <row>
            <entry>rich-spinner-button-down</entry>
            <entry>a button for value decreasing</entry>
          </row>
        </tbody>
      </tgroup>
    </table>
    <para>It&apos;s necessary only to define a class according to the corresponding name, so as
      an appearance of all <property>spinners</property> on a page is changed at once. </para>
    <para>To redefine appearance of the particular <property>spinner</property>, it&apos;s
      possible to define your own CSS class. Then it&apos;s necessary just to define it in one
      of the <emphasis>
        <property>&quot;components class&quot;</property>
      </emphasis> attributes modifying component style properties.</para>
    <para>
      <emphasis role="bold">Example:</emphasis>
    </para>
    <para>CSS code piece used on a page:</para>

    <para>
      <emphasis role="bold">Example:</emphasis>
    </para>
    <programlisting role="XML"><![CDATA[...
    . rich-spinner-input {
            font-style:italic;
        }
    .myClass {
            font-weight: bold;
        }
...
]]></programlisting>
    <para>The component is defined in the following way:</para>

    <para>
      <emphasis role="bold">Example:</emphasis>
    </para>
    <programlisting role="XML"><![CDATA[<rich:inputNumberSpinner inputClass="myClass" .../>
]]></programlisting>
    <para>Hence, a font-style of all <property>spinners</property> is redefined on a page as well as
      a font-weight for an entry field of the particular <property>spinner</property>.</para>
  </section>
  <section>
    <title>Relevant resources links</title>
    <para>
      <ulink
        url="http://livedemo.exadel.com/richfaces-demo/richfaces/inputNumberSpinner.jsf?c=inputNumberSpinner"
        >Here</ulink> you can see the example of <emphasis role="bold"
        >&lt;rich:inputNumberSpinner&gt;</emphasis> usage and sources for the given example.
    </para>
  </section>

</section>
