Draggable

Table of Contents

Overview

Since 3.0

The <ace:draggable> tag gives another component the capability to be dragged.

See the ICEfaces Showcase Live Demo of this component, complete with source code.

Getting Started

The component we want to make draggable is specified as the value of the for attribute.

<h:graphicImage id="sampleImage" value="#{bean.imagePath}" />

<ace:draggable for="sampleImage" />

Alernatively, the for value can be omitted and the parent component will be made draggable.

<h:graphicImage id="sampleImage" value="#{bean.imagePath}">
    <ace:draggable />
</h:graphicImage>

Attributes

TagLib Documentation
This section covers attributes involved in the typical use-cases for this component. For reference, the complete taglib documentation for this component is available here.

for Id of the component that will have the draggable capabilities.

helper Specifies whether to move the original node or a clone of it. Possible values are 'original' and 'clone' (default is 'original').

opacity Specifies the opacity for the helper node during dragging. Values can range from 0.00 to 1.00.

scope Keyword of this draggable component. This draggable will only be allowed to be dropped on droppables with the same keyword.

axis Used to restrict the drag movement of this item to an axis. Possible values are 'x', 'y' or null for no restriction (default is null).

containment Id of the parent component whose boundaries should restrict the movement of this draggable.

Event Listeners

dragStartListener Method called whenever the draggable component starts to be dragged. The method receives a single DragDropEvent argument.

Client Behavior Events

start Fired when the draggable component starts to be dragged (default event).

JavaScript APIs

ICEfaces 3.x

The client side component object is exposed through the global variable name specified in the widgetVar attribute.

ICEfaces 4+

The "widgetVar" attribute on the ACE components has been removed in ICEfaces 4 and in its place a new "ice.ace.instance()" client JavaScript object lookup API has been introduced. The reason for this change is to enable lazy-initialization of the ACE component JavaScript objects to improve runtime performance and reduce browser memory use.

var widget = ice.ace.instance('frm:componentId);
The ice.ace.instance function requires the full client id of the component to be specified, such as "j_idt77:componentId" instead of just "componentId". To reduce the complexity of working with complete IDs with this function it may be preferable in some cases to use prependId="false" in the enclosing form (e.g. <h:form prependId="false">).
This component doesn't have a client-side API made specifically to be used by application developers. However, the component's internal methods and variables can be accessed in this way, including the underlying jQuery object and objects from underlying Javascript libraries (if applicable), and can be used for whatever purpose a developer might have in mind.

Keyboard and ARIA support

At the moment, there is no keyboard and ARIA suppport.

Known Issues

When using either of dragStartListener or the start ajax event, it is advised not to make significant updates to the component being dragged, since this may cause a dynamic update and replacement of the entire markup of the component in the client. Thus, if the user is still dragging the component, they may lose the handle of it when this update occurs. There is no problem updating components that are inside the component being dragged. There is also no problem updating components that are outside of the component being dragged, as long as they don't cause a full form update if the component being dragged is inside such form. If this scenario should occur, it is very likely that it can be avoided by making certain changes on the facelet.

Other Resources

None.

Enter labels to add to this page:
Please wait 
Looking for a label? Just start typing.

© Copyright 2021 ICEsoft Technologies Canada Corp.