Hi,
I have a “legacy” application, which has been upgraded from vaadin 7 to 8.
Now I want to reimplement it using Vaadin 19.
I would like to re-use respectively rebuild some of the custom Java components with Flow, but Fusion seems to have some advantages and I would like to look into it for future developments, especially for client-side components.
I have used the start.vaadin.com tool to generate a hybrid app and mixed some of the views to get familiar with it.
Now I have a few essential questions, since I’ve only has a bit of experience with simple React apps, but kept away from more complex frontend stuff which is why Vaadin was my prefered framework for building a GUI:
I have the main-view.ts, which defines the component.
I have nested a div into the header component with the id “entityId” and a value, which should show the entity name.
Below the header I have inserted a “good old” Java based view.
This view only shows a button, which has a click listener.
Is it possible to access the div with the id “entityId” in the header from the button click event from the server side in the Java-based view?
A second question:
Alternatively I tried to use another fusion based view to add a button in the .ts and added a click listener there.
For that one I used:
document.getElementById('entityId')!.innerHTML = "THIS VALUE HAS BEEN CHANGED BY BUTTON CLICK!";
To change the “entityId” value.
But this only works when I add the div in the view.ts, the main-view.ts’ “entityId” div is not found respectively above method will then return a null exception.
Is this also even possible? Do I need to indicate a context or pass the object somehow?
If this is possible could you point me to a tutorial which goes into this or something in the documentation?
I don’t even know what to look for.
Thanks & best regards