<?xml version="1.0" encoding="UTF-8"?>
<section>
  <sectioninfo>
    <keywordset>
      <keyword>drag and drop</keyword>

      <keyword>rich:dndParam</keyword>

      <keyword>HtmlDndParam</keyword>

      <keyword>drop Zone</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.DndParam</entry>
          </row>

          <row>
            <entry>component-class</entry>

            <entry>org.richfaces.component.html.HtmlDndParam</entry>
          </row>

          <row>
            <entry>tag-class</entry>

            <entry>org.richfaces.taglib.DndParamTag</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, nested in one of the drag-and-drop components:</para>


    <para>
      <emphasis role="bold">Example:</emphasis>
    </para>
    <programlisting role="XML"><![CDATA[...
    <rich:dragSupport dragType="file">
        <rich:dndParam name="testDrag" value="testDragValue" 
                        type="drag"/>
    </rich:dragSupport>
...
]]></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.HtmlDndParam;
...
HtmlDndParam myDparam = new HtmlDndParam();
...
]]></programlisting>
  </section>

  <section>
    <title>Details of Usage</title>

    <para><property>dndParam</property> is used during drag-and-drop
    operations to pass parameters to an indicator. At first, a parameter type
    is defined with the type attribute (to specify parameter functionality),
    then a parameter name could be defined with the name and value attribute.
    Although, it&apos;s possible to use nested content defined inside
    <property>dndParam</property> for value definition, instead of the
    attribute.</para>

    <para>Variants of usage:</para>

    <itemizedlist>
      <listitem><para>Parameters passing for a drag icon when an indicator is in
      drag.</para></listitem>
    </itemizedlist>

    <para>In this case, <property>dndParam</property> is of a drag type
    and is defined in the following way:</para>


    <para>
      <emphasis role="bold">Example:</emphasis>
    </para>
    <programlisting role="XML"><![CDATA[...
    <rich:dragSupport ...> 
        <rich:dndParam type="drag" name="dragging"> 
            <h:graphicImage value="/img/product1_small.png"/> 
        </rich:dndParam> 
        <h:graphicImage value="product1.png"/> 
    </rich:dragSupport>
...
]]></programlisting>

    <para>Here <property>dndParam</property> defines an icon that is used by
    an indicator when a drag is on the place of a default icon (e.g. a
    minimized image of a draggable element)</para>

    <itemizedlist>
      <listitem><para>Parameters passing for an indicator informational part during
      a drag.</para></listitem>
    </itemizedlist>

    <para>In this case <property>dndParam</property> is of a drag type
    and is defined in the following way:</para>


    <para>
      <emphasis role="bold">Example:</emphasis>
    </para>
    <programlisting role="XML"><![CDATA[...
    <rich:dragSupport ...> 
        <rich:dndParam type="drag" name="label" value="#{msg.subj}"/>
        ...
    </rich:dragSupport>
...
]]></programlisting>

    <para>The parameter is transmitted into an indicator for usage in an
      informational part of the <property>dragIndicator</property> component (inside an indicator a
    call to {label} happens)</para>

    <itemizedlist>
      <listitem><para>Parameters passing happens when dragged content is brought
      onto some zone with <property>dropSupport</property></para></listitem>
    </itemizedlist>

    <para>In this case <property>dndParam</property> is of a drop type and is
    defined in the following way:</para>


    <para>
      <emphasis role="bold">Example:</emphasis>
    </para>
    <programlisting role="XML"><![CDATA[...
    <rich:dropSupport ...> 
        <rich:dndParam type="drop" name="comp" > 
            <h:graphicImage height="16" width="16" value="/images/comp.png"/> 
        </rich:dndParam>
        ...
    </rich:dropSupport >
...
]]></programlisting>

    <para>Here, <property>dndParam</property> passes icons into an indicator,
    if dragged content of a comp type is above the given drop zone that
    processes it on the next drop event.</para>
  </section>
  
  <section>
    <title>Look-and-Feel Customization</title>
    
    <para><emphasis role="bold">
      <property>&lt;rich:dndParam&gt;</property>
    </emphasis> has no skin parameters and custom <property>style classes</property>, as the
      component isn&apos;t visual.</para>
  </section>
  
  <section>
    <title>Relevan Resources Links</title>
    <para><ulink url="http://livedemo.exadel.com/richfaces-demo/richfaces/dragSupport.jsf?c=dndParam"
      >On the component LiveDemo page</ulink> you can see the example of <emphasis role="bold"
        ><property>&lt;rich:dndParam&gt;</property></emphasis> usage and sources for the given example. </para>
  </section>    
</section>