Search code examples
javavaadinvaadin8vaadin-gridvaadin10

Vaadin Push not working in 10 (flow)


In Vaadin 8, I am able to asynchronously update a Grid with incoming websocket data using the access method of UI, which locks the thread and performs the updates, then pushes them without the client having to request it.

access(() -> addMessage(message));

I am trying to use vaadin 10 now, and since the main class you start with doesn't extend UI, I am trying to do it like this:

UI.getCurrent().access((Command) () -> addTrade(message))

However it is not working, and you have to click somewhere on the page for the update to happen. I have the @Push annotation on the class, so I believe server push should work.. thank you so much guys!

in my servlet:

asyncSupported = true

have also tried this.getUI().get().access(), still not updating.


Solution

  • This is most likely caused by https://github.com/vaadin/flow/issues/3256 that is currently being fixed.

    The tickets also suggests a workaround: grid.getElement().getNode().markAsDirty();. If the workaround solves the issue, then it's very likely caused by that bug. If not, then there's some other issue that would require further investigation.