Drag and drop JSP tags

 

+

Search Tips   |   Advanced Search

 

This topic provides a description of the JSP tags and attributes for the drag and drop feature.

 

<dnd:drag/>

This tag designates its content as a drag zone that can be dropped into drop zones of matching types. The following attributes are used with this tag.

type

Required. This value is used to identify drag and drop zones that match and to prevent drag zones designed for one specific application from inadvertently being dropped into a drop zone from an unrelated application. To make a drop possible, there must be at least one drop zone on the page that is the same type as this <dnd:drag/> tag.

namespace

Optional. This value is used to further qualify the type attribute. If namespace is specified, then only drop zones with a matching namespace and type can accept this drag content. The value wp is a reserved namespace.

value

Required. This value is combined with the name attributes of a matching drop tag to create a parameter for the URL specified by the action attribute.

validator

Optional. Indicates the fully-qualified class name of a Java class that can determine if the user has access rights to drag the content.

cssClassName

Optional. Indicates the CSS class name to replace the dndDragging class. If specified, this style class must be present in the style class. See Style classes used for drag and drop for more information.

optionalOnDragJavascript

Optional. Indicates a JavaScript method or function on the page that should be called when the user presses the mouse button down on the drag zone's handle.

multiselectable

Optional. This is a boolean value that indicates whether this content can be selected along with other drag zones for a single drag and drop operation using the Ctrl key plus left mouse click combination. The default is false.

includeDragHandle

Optional. Indicates whether the drag handle is included in the drag content. This parameter works with the <dnd:dragHandle/> tag as follows.

  • If <dnd:dragHandle/> tags are provided in the drag zone, set this attribute to false so that only the drag handle is selectable and users can interact with the remainder of the drag content.

  • If no <dnd:dragHandle/> tags are provided within the drag zone, the entire drag content is the handle. In this case, setting this value to false prevents the drag zone from being selected and dragged.

The default is true.

dragClone

Optional. Indicates whether the drag content is moved (false) or copied (true) to the drop zone. This value applies only to how the drag zone appears while it is dragged. The actual moving or copying of content is carried out by the code invoked by the action in the <dnd:drop/> tag. The default is false.

 

<dnd:dragHandle/>

This tag designates its content to be used as a visual handle for the drag operation. If this tag is not provided within the <dnd:drag/> tag, the entire drag content is used as a handle. This tag must have content and can only be used within a <dnd:drag/> tag. Multiple drag handles are allowed within a drag zone. There are no attributes for this tag.

 

<dnd:drop/>

This tag designates the content of the tag as a drop zone that can accept content from drag zones of matching types. Drop zones have three states:

  • dormant: a drag zone is not being dragged

  • aware: a drag zone is being dragged

  • active: a drag zone is being dragged and the drop zone is the closest in proximity and will be the recipient of the drop

The following attributes are used with this tag.

type

Required. This value is used to identify drag and drop zones that match and to prevent drag zones designed for one specific application from inadvertently being dropped into a drop zone from an unrelated application. To make a drop possible, there must be at least one drag zone on the page with the same type as this <dnd:drop/> tag.

namespace

Optional. This value is used to further qualify the type attribute. If namespace is specified, then only drag zones with a matching namespace and type can be dropped in this drop zone. The value wp is a reserved namespace.

action

Required. Indicates a URL. The action is equivalent to the action on an HTML form. The input parameter to the action is derived from the name attribute from the drop tag and the value attribute from the drag tag. This parameter is available in the request so that portlets can obtain the value using renderRequest.getParameter(“name”).

name

Required. Indicates the name to be matched with a value from a matching drag zone. The name/value pair is appended to the URL specified by the action attribute.

supportsMultiselect

Optional. This is a boolean that indicates whether multiple drag zones of matching type can be dropped into this drop zone. The default is false.

multiselectDelimiter

Optional. Indicates a string that is inserted as a delimiter between multiple properties in the action URL. For example, if the action received two properties, direction and color, you could specify the character | as a delimiter and the portlet's actionPerformed() method would parse these properties from: direction=up|color=green. This value is required only if supportsMultiselect is set to true.

optionalActionJavascript

Optional. Indicates a JavaScript method or function on the page that should be called when the drop is complete.

validator

Optional. Indicates the fully-qualified class name of a Java class that can determine if the user has access rights to drag the content.

activeCssClassName

Optional. Indicates the CSS class name to replace the dndDropActive class. If specified, this style class must be present in the style class. See Style classes used for drag and drop for more information.

awareCssClassName

Optional. Indicates the CSS class name to replace the dndDropAware class. If specified, this style class must be present in the style class. See Style classes used for drag and drop for more information.

 

<dnd:additionalAction/>

This tag provides an additional action associated with the parent <dnd:drop/> tag. We can provide any number of additional actions in a drop zone. The following attributes are used with this tag.

type

Required. This value is used to identify drag and drop zones that match and to prevent drag zones designed for one specific application from inadvertently being dropped into a drop zone from an unrelated application. For the <dnd:additionalAction/> tag, this value can be used to assign multiple actions in a drop zone to drag zones of the same type.

namespace

Optional. This value is used to further qualify the type attribute. If namespace is specified, then only drag zones with a matching namespace and type are associated with this action. The value wp is a reserved namespace.

action

Required. Indicates a URL. The action is equivalent to the action on an HTML form. The input parameter to the action is derived from the name attribute from the drop tag and the value attribute from the drag tag. This parameter is available in the request so that portlets can obtain the value using renderRequest.getParameter(“name”).

name

Required. Indicates the name to be matched with a value from a matching drag zone. The name/value pair is appended to the URL specified by the action attribute.

supportsMultiselect

Optional. This is a boolean that indicates whether multiple drag zones of matching type can be dropped into this drop zone. The default is false.

multiselectDelimiter

Optional. Indicates a string that is inserted as a delimiter between multiple properties in the action URL. For example, if the action received two properties, direction and color, you could specify the character | as a delimiter and the portlet's actionPerformed() method would parse these properties from: direction=up|color=green. This value is required only if supportsMultiselect is set to true.

optionalActionJavascript

Optional. Indicates a JavaScript method or function on the page that should be called when the drop is complete.

validator

Optional. Indicates the fully-qualified class name of a Java class that can determine if the user has access rights to drag the content.

activeCssClassName

Optional. Indicates the CSS class name to replace the dndDropActive class. If specified, this style class must be present in the style class. See Style classes used for drag and drop for more information.

awareCssClassName

Optional. Indicates the CSS class name to replace the dndDropAware class. If specified, this style class must be present in the style class. See Style classes used for drag and drop for more information.

 

<dnd:additionalProperty/>

The tag provides additional properties that can be included in the parent <dnd:drag/>, <dnd:drop/>, or <dnd:additionalAction/> tag. We can provide any number of additional properties to the parent tag. The following attributes are used with this tag.

type

Required. This value is used to associate the property with other drag zones or drop zones.

namespace

Optional. This value is used to further qualify the type attribute. If namespace is specified, then this property can only be associated with drop zones or drag zones with a matching namespace and type. The value wp is a reserved namespace.

name

Required only when this tag is included in a <dnd:drop/> or <dnd:additionalAction/> tag. Indicates the name to be matched with a value from a matching drag zone. The name/value pair is appended to the URL specified by the action attribute.

value

Required only when this tag is included in a <dnd:drag/> tag. This value is combined with the name attributes of a matching drop tag to create a parameter for the URL specified by the action attribute.

 

<dnd:DNDPortletHelper/>

This is tag is required for portal themes and skins prior to other drag and drop markup. This tag takes no content or attributes.