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

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

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. /:

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.

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,

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