JBoss.orgCommunity Documentation
Table 6.143. rich : dndParam attributes
Table 6.144. Component identification parameters
Name | Value |
---|---|
component-type | org.richfaces.DndParam |
component-class | org.richfaces.component.html.HtmlDndParam |
tag-class | org.richfaces.taglib.DndParamTag |
Here is a simple example as it could be used on a page, nested in one of the drag-and-drop components:
Example:
...
<rich:dragSupport dragType="file">
<rich:dndParam name="testDrag" value="testDragValue"
type="drag"/>
</rich:dragSupport>
...
Example:
import org.richfaces.component.html.HtmlDndParam;
...
HtmlDndParam myDparam = new HtmlDndParam();
...
dndParam 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's possible to use nested content defined inside dndParam for value definition, instead of the attribute.
Variants of usage:
Parameters passing for a drag icon when an indicator is in drag.
In this case, dndParam is of a drag type and is defined in the following way:
Example:
...
<rich:dragSupport ... >
<rich:dndParam type="drag" name="dragging">
<h:graphicImage value="/img/product1_small.png"/>
</rich:dndParam>
<h:graphicImage value="product1.png"/>
</rich:dragSupport>
...
Here dndParam 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)
Parameters passing for an indicator informational part during a drag.
In this case dndParam is of a drag type and is defined in the following way:
Example:
...
<rich:dragSupport ... >
<rich:dndParam type="drag" name="label" value="#{msg.subj}"/>
...
</rich:dragSupport>
...
The parameter is transmitted into an indicator for usage in an informational part of the dragIndicator component (inside an indicator a call to {label} happens)
Parameters passing happens when dragged content is brought onto some zone with dropSupport
In this case dndParam is of a drop type and is defined in the following way:
Example:
...
<rich:dropSupport ... >
<rich:dndParam type="drop" name="comp" >
<h:graphicImage height="16" width="16" value="/images/comp.png"/>
</rich:dndParam>
...
</rich:dropSupport >
...
Here, dndParam 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.
<rich:dndParam> has no skin parameters and custom style classes, as the component isn't visual.
On the component LiveDemo page you can see the example of <rich:dndParam> usage and sources for the given example.