# Drag and Drop a gateway tag on a table component from within a module

**URL:** <https://forum.inductiveautomation.com/t/drag-and-drop-a-gateway-tag-on-a-table-component-from-within-a-module/42206>\
**Category:** Module Development\
**Tags:** ignition79\
**Created:** [January 13, 2021, 3:34pm UTC](https://forum.inductiveautomation.com/t/drag-and-drop-a-gateway-tag-on-a-table-component-from-within-a-module/42206 "2021-01-13T15:34:08Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![rkumar](https://avatars.discourse-cdn.com/v4/letter/r/4491bb/32.png) [@rkumar](https://forum.inductiveautomation.com/u/rkumar)\
**Post date:** [January 13, 2021, 3:34pm UTC](https://forum.inductiveautomation.com/t/drag-and-drop-a-gateway-tag-on-a-table-component-from-within-a-module/42206/1 "2021-01-13T15:34:08Z")

</div>

Hello,

We are trying to create a component and add

- a table onto this component
- drag a gateway tag on this table and show it’s values as a row

The behavior should be similar to transaction group drag and drop.

Approach:

- created a module with AbstractVisionComponent
- Added an AbstractVisionPanel with PMI table in this component
- On uploading the module, we are able to see the component and the table on the designer window
- While dragging a tag onto this table
  - We are using “DropTargetListener” to capture the event on the panel but it is not getting fired
  - when we ran this as a sample independent class in Java, it is getting fired correctly

Please validate the approach and let us know where we are doing wrong or guide us in meeting the requirement

thanks,  
Rajiv Kumar,  
OpteBiz Inc.  
Taledo, OH USA

---

<div class="post-metadata">

**Author:** ![pturmel](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/pturmel/32/3295_2.png) [@pturmel](https://forum.inductiveautomation.com/u/pturmel)\
**Post date:** [January 13, 2021, 4:47pm UTC](https://forum.inductiveautomation.com/t/drag-and-drop-a-gateway-tag-on-a-table-component-from-within-a-module/42206/2 "2021-01-13T16:47:22Z")

</div>

Doesn’t seem like there’s anything wrong with your approach. But you might find it easier to sub-class the PMITable or AdvancedVisionTable components to add your functionality.

Anyways, more detailed advice will require more of your code posted. It is hard to find what is missing if one doesn’t have everything to look at. /:

---

<div class="post-metadata">

**Author:** ![paul-griffith](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/paul-griffith/32/37249_2.png) [@paul-griffith](https://forum.inductiveautomation.com/u/paul-griffith)\
**Post date:** [January 13, 2021, 5:18pm UTC](https://forum.inductiveautomation.com/t/drag-and-drop-a-gateway-tag-on-a-table-component-from-within-a-module/42206/3 "2021-01-13T17:18:22Z")

</div>

Tag drops in the designer should be handled by the component’s bean info, not as a drop target listener; see the methods on [`CommonBeanInfo`](http://files.inductiveautomation.com/sdk/javadoc/ignition81/8.1.0/com/inductiveautomation/vision/api/designer/beans/CommonBeanInfo.html#installTagDropHandler()).

---

<div class="post-metadata">

**Author:** ![mlunapinel](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/mlunapinel/32/19719_2.png) [@mlunapinel](https://forum.inductiveautomation.com/u/mlunapinel)\
**Post date:** [January 28, 2021, 7:50am UTC](https://forum.inductiveautomation.com/t/drag-and-drop-a-gateway-tag-on-a-table-component-from-within-a-module/42206/4 "2021-01-28T07:50:29Z")

</div>

In case that I’d like to add a Tag Drop Handler to a swing table in the designer (in a tabbed resource editor), is that the class to use?

Thanks,

---

<div class="post-metadata">

**Author:** ![paul-griffith](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/paul-griffith/32/37249_2.png) [@paul-griffith](https://forum.inductiveautomation.com/u/paul-griffith)\
**Post date:** [January 28, 2021, 4:47pm UTC](https://forum.inductiveautomation.com/t/drag-and-drop-a-gateway-tag-on-a-table-component-from-within-a-module/42206/5 "2021-01-28T16:47:05Z")

</div>

No, within a regular designer panel (_not_ a Vision `DesignableWorkspace` or whatever the base class is called) you would have to set up standard Swing Drag & Drop handling, but use one of the static final constants on `NodeListTransferable` as the expected `DataFlavor`, eg:  
`com.inductiveautomation.ignition.designer.tags.tree.dnd.NodeListTransferable#FLAVOR_NODE_INFO_LIST`
