nick
nick

Reputation: 249

Vaadin UI between sessions

When I am creating a new session (or try to access from an other computer) in Vaadin Flow I get this error:

Can't move a node from one state tree to another

From this link, I read something about UI and getUIId().

However, I don't understand how I should change my application in order to fix the error.

Upvotes: 1

Views: 251

Answers (2)

ollitietavainen
ollitietavainen

Reputation: 4275

One possible cause of errors such as that is that if you're storing a Component in a static variable. You shouldn't do that - a Component instance can only belong to a single UI. A single UI in turn (in practice) means a single browser tab.

Upvotes: 1

Anna Koskinen
Anna Koskinen

Reputation: 1370

As Denis mentioned in the forum post you linked, wrong scope sounds like the most likely culprit. In other words, you are trying to use the exact same component instance in two different UIs, when both UIs should have their own instance. It's not possible to use the same instance in two places at the same time.

You can find the documentation for Vaadin Spring scopes here: https://vaadin.com/docs/latest/flow/integrations/spring/scopes

Upvotes: 3

Related Questions