cancel
Showing results for 
Search instead for 
Did you mean: 

Drag & Drop between two component

prathamesh_gandhi
Participant
0 Kudos

Hi All,

I have a requirement where my DROP component need to be reusable, as it need to be embed in different components.

I am using ViewContinerUIElement to embed the reusable component, and i am able to show that drop area also.

but i am not able to trigger ON_DROP event of table UI element.

can someone guide me on this. how can i call DROP event of reusable component.

Thanks In Advance,

P$G.

Accepted Solutions (1)

Accepted Solutions (1)

amy_king
Active Contributor
0 Kudos

Hi Prathamesh,

Take a look at demo component WDR_TEST_DRAG_AND_DROP in your system. It is an example of cross-component drag-and-drop. In the example application, if you change the scope of both the DragSourceInfo and the DropTargetInfo to global, you are able to drag-and-drop between components.

Cheers,

Amy

prathamesh_gandhi
Participant
0 Kudos

Thanks Amy,

Now I am able to get the DROP event, but unable to get the context node values.

i.e in first component i have two interface nodes (Which values will get drag), in second component I have one interface node (which will hold drop values).

i have used second component into first component, now ON_DROP (in Second component) it is not giving me values of two interface node of my first component.

can you suggest what I have missed.

Thanks In Advance,

P$G

amy_king
Active Contributor
0 Kudos

Hi Prathamesh,

If you want the component B to have access to component A's interface nodes, you need to add component A as a used component to component B. If I understand you correctly, it sounds like you have this reversed.

Cheers,

Amy

prathamesh_gandhi
Participant
0 Kudos

Yes Amy, I already did same. I have added component in used component.

is it because I have embed my second component into ViewContainerUIElment of first component ?

sahai
Contributor
0 Kudos

Hi,

Please note that if you need to pass values from a view to another, the node should be declared in Component controller. This will make it as a global node and the value bound to this node will be available in the second view also.

Thanks and regards,

Shitanshu Shai

amy_king
Active Contributor
0 Kudos

Hi Prathamesh,

Let me see if I understand your scenario correctly...

You have a component DRAG with two interface nodes A and B and a component DROP with one interface node C. In DRAG, you have listed DROP as a used component because you embed a view from DROP into a view container in one of the DRAG views.

So far, DRAG is using DROP so DRAG has access to node C, but DROP is not using DRAG and so DROP does not have access to nodes A or B.

Are you saying you want component DROP to have access to nodes A and B? If yes, you need to list DRAG as a used component in DROP.

I hope I have understood your requirement.

Cheers,
Amy

Answers (0)