Interacting with JS Component (Drag and Drop)

Hi,

I am looking for your estimation whether the following is possible or if it is more advisable to look for another solution:

  • Given a JS framework for creating specialized diagrams which has not yet been wrapped/integrated with vaadin
  • I want to interact with the vaadin environment, e.g. have a vaadin-element, drag it and drop it onto a diagram created by the JS framework
  • Based on the drop event, I trigger something in the JS world
  • When the user clicks onto an element of the diagram (i.e. on a JS element), I want to trigger something in the Java world

Is this scenario, especially the drag and drop functionality, possible?

  1. Depends on the JS Framework but why not…Pretty much every Framework should work.
  2. You could use the Standard Vaadin DragAndDropWrapper. This way you don’t have to do something custom and the functionality it brings could be enough like basic dragging and Drop Handling
  3. In the Drop event you could call a method of your Server-side component class which then executes a Client RPC to your JS client side
  4. This could be done by a ServerRPC

Check the vaadin wiki for information on any of the above:
https://vaadin.com/wiki

Thanks for your answer and the references! I will have a look at them.