Vaadin lets you build secure, UX-first PWAs entirely in Java.
Free ebook & tutorial.
Interacting with JS Component (Drag and Drop)
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?
- Depends on the JS Framework but why not...Pretty much every Framework should work.
- 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
- 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
- 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.