-
4 May 2009 1:28 AM #1
[FIXED] [2.0 M1] Bug in dragSource.disable()
[FIXED] [2.0 M1] Bug in dragSource.disable()
When using the DnD functionality, I want to disable the dragSource when an event happens. I've got it working, but it seems GXT doesn't really disable the dragging, but only hides the content. It is still possible to drag and it leaves a artifact at the right bottom of the mouse cursor (as shown on screenshot)
Code sample (without get/setters and imports) :
public class QueueCurrent extends LayoutContainer {
private Html html;
private String callerNumber;
private String sourceChannel;
private Button redirectButton;
private Button notesButton;
private NoteDetailsWindow noteWindow = new NoteDetailsWindow();
private DragSource source;
private StaticServiceAsync asterSvc = GWT.create(StaticService.class);
public QueueCurrent() {
setLayoutOnChange(true);
setBorders(true);
setSize(200, 50);
html = new Html();
add(html, new FlowData(3));
source = new DragSource(html) {
@Override
protected void onDragStart(DNDEvent event) {
// by default drag is allowed
event.setData(html);
event.getStatus().update(
El.fly(html.getElement()).cloneNode(true));
}
@Override
protected void onDragDrop(DNDEvent event) {
super.onDragDrop(event);
System.out.println("DragSource: " + event.getDragSource());
System.out.println("DropTarget: " + event.getDropTarget());
}
};
// group is optional
source.setGroup("dnd-call");
// Set initial state
unsetCallData();
}
/**
* Set the source channel of the DnD box, needed for redirecting
*/
public void setCallData(String name, String sourceChannel, String callerNumber) {
html.setHtml(name);
html.setStyleName("queueCurrent-active");
html.setToolTip("Kanaal: " + sourceChannel);
setSourceChannel(sourceChannel);
setCallerNumber(callerNumber);
redirectButton.setEnabled(true);
notesButton.setEnabled(true);
source.enable();
}
public void unsetCallData( ) {
html.setHtml("---");
html.setStyleName("queueCurrent-inactive");
html.hideToolTip();
setSourceChannel(null);
setCallerNumber(null);
redirectButton.setEnabled(false);
notesButton.setEnabled(false);
source.disable();
}
}
-
5 May 2009 2:42 AM #2
As i've compiled the application to Firefox, it seems that FF doesn't show above artifact under the cursor.
If I open the same compiled site in IE7, the dashed artifact does show up. It isn't a Hosted-Mode only bug...
-
5 May 2009 2:44 AM #3
Yes i confirmed that and have a fix ready.
-
5 May 2009 7:28 AM #4
Looks like the Hosted mode does use IE to render things.. :P
-
7 May 2009 1:33 AM #5
Is it also possible to disable the status fly ghost item? When the DragSource is disabled, the ghost still stays active. I can't find a way to disable the ghost.
Besides that,, how can I drag DataListItems? The example explorer tells about List to List dnd, but I want to drop a list item at top of a other target (button). The ListViewDragSource is able to drag multiple items, but I only want to drag one item.
-
7 May 2009 1:37 AM #6
Actually, it looks like the List selection mode is blocking the DnD event. Is it possible to disable a list from selection?
-
13 May 2009 8:20 AM #7
-
26 May 2009 1:45 AM #8
The bug is solved in the M2 build. Now a selection will be made. Is it possible to override this select action? The entire viewport is filled with blue because of the selection.
-
27 May 2009 2:14 AM #9
DnD DataList
DnD DataList
I can't figure out how to make the items in a datalist draggable, is this fixed in the M2 build or am i doing something wrong?
Playing with some of the DataList properties doesn't work...Code:public class QueueItem extends DataListItem { ............ public QueueItem(String callerIdName, String phoneNumber, String uniqueId, String channel, String queueName) { ....... source = new DragSource( this ) { @Override protected void onDragStart(DNDEvent event) { // by default drag is allowed event.setData( getChannel() ); event.getStatus().update( getCallerIdName() ); System.out.println("DragStart"); } }; // group is optional source.setGroup("dnd-call"); } }
-
28 May 2009 4:34 AM #10
Anybody who has got the Dragging working withing lists?
Thank you for reporting this bug. We will make it our priority to review this report.


Reply With Quote