problem with widget


how can i get what image is cancelled? Now I have 2 differents images from my data table, but now i need indicate what image is cancelled?


When you created the drag & drop OP, you provided it with payload; you can now get it from the Operation and cast it to the appropriate object type, presumably ItemBind widget.

Yes, I can but how can i use payload to check what is drop in drag & drop?

It’s easy to get Payload object but to Payload is problem to set what object is dropped?

Not sure if I understood that. Could you rephrase it somehow? What are you setting as Payload when the Drag Operation is created?

I didn’t set nothing. That creating problem.

Check my all code.

If you see cancelled I don’t know how to retrieve variables which is cancelled

Well, you did not specify what the *Payload *(the object you’re dragging) is… you left it empty. The same goes for Default Drag *Visual *(how it looks like). If you want the Payload to be the widget that initiated the drag & drop OP, plug in *Self. *Or perhaps you just need an image, so plug in the image as payload.

When you cancel, get *Payload *from the *Operation *pin -> cast to widget / image (depending on what the payload is).

I will be very happy if you can tell me how it is possible to get payload to Create dragdrop test if I have an image from datatable?
I can’t get also Tag and other, like name…

Now I use widget with Itembind name and I call with Create ItemBind Widget. From here everything is working. I can’t get image object to payload from datatable.
That is problem.

I cannot found any example in internet how to retrieve from datatable to Payload…

Maybe Payload detect automatically what is dragged from data table?

I used also Payload using Self I got only one name always.

Assuming the ItemBind is the widget that has the image.

Correct. I have image in Itembind.

and if use on Cancelled in Operation I got: dragdroptest_123, dragdroptest124…

And error is:
If Used Get All widgets of Class with Get and then Image67 I got: Blueprint Runtime Error: “Accessed None trying to read property CallFunc_Array_Get_Item”. Blueprint: DRAGDET Function: On Drag Detected Graph: OnDragDetected Node: Create Drag & Drop Operation

If I used For Each Loop and Operation is empty.

Check my pictures and from your example must work…

You’re overcomplicating things :wink:

The image with the brush updated from the data table is *already *part of this widget, just drag it to the graph.

Btw, you should be detecting drag in the dragged widget, not in its parent. Each child sitting in the horizontal box needs this functionality.

And how can I retrieved images if I have images in ItemBind?

If I used all in one widget, then how can I created each loop to show more pictures if exists more pictures. Now I Create Widget for each picture which is exist.

Check this picture how I retrieved images.

Oh so, sorry I didn’t see your last:
Btw, you should be detecting drag in the dragged widget, not in its parent. Each child sitting in the horizontal box needs this functionality.

Yeah, you need this in the child - inside the widget that you are dragging; otherwise, it would be almost impossible to pull off.

Thanks a lot for this solution!!

hello again,

i hope you can help me again.

from yesterday I didn’t check correctly print string. Today I saw If I used Image_67 always is print string Payload Image_67 from your example.

That’s a correct behaviour, you’re printing variable name. As mentioned above, cast the Payload, get the brush, get the image:

Alternatively, you can do it during assigning payload, then the drag operation will carry just the brush’s Image.

It’s confusing because your *Widget *has an *Image Widget *that has a *Brush *with an Image. And that’s why I rename EVERYTHING :wink:

Thanks a lot again, its working!