1 year ago

#357780

test-img

Oliver Stahl

Vaadin23 navigate is not working in BeforeEnterEvent

I try to check if specific parameters of a url are valid. If they aren't the user should be navigated to a different route. It's important that it's a navigate and not a redirect.

When i try to use UI.getCurrent().navigate() in der BeforeEnterEvent i'm experiencing some weird issues.

Some workarround i found is when i call the navigate method in the UI.getCurrent().access() function. Since then the code will be executed at a later point.

UI.getCurrent().access(() -> UI.getCurrent().navigate(""));

So i'm wondering if this is the right way to do this because this seems pretty bad. Is there a better event to call the navigate method?

vaadin

vaadin-flow

vaadin14

0 Answers

Your Answer

Accepted video resources