Now when I want to open the OrderDetailView not in the dialog, but as a regular full-screen view, it does not hold the tempary state of the customer object anymore. Instead it asks if I want to save the entity before closing the window:
entering information about the customer and clicking the create order button
order detail view is not opened
The only thing I changed over the generated code from studio:
By design, nested views must be opened in the dialog widow. Currently, with Vaadin Flow opening nester views in the same window isn’t possible. The reasons are:
Views (Screens) are created based on a route.
This means that when the user navigates to some route (e.g., http://example.com/some/path), either by clicking a link in the application or entering the address in the address bar, corresponding UI component (the one with the @Route("some/path") annotation) is created and shown on the page (See docs).
Changes in the @PreserveOnRefresh annotation:
Vaadin 8
Marks a UI that should be retained when the user refreshed the browser window. By default, a new UI instance is created when refreshing, causing any UI state not captured in the URL or the URI fragment to get discarded. By adding this annotation to a UI class, the framework will instead reuse the * current UI instance when a reload is detected.
Vaadin Flow
Indicates that a previous view instance should be-reused when reloading a location in the same browser window/tab.
From Vaadin doc: Preserving UIScope beans
Unlike with earlier Vaadin versions 7 and 8, the UI and thus the UIScope beans are not preserved when the @PreserveOnRefresh annotation is used and the browser is refreshed. In order to preserve the beans on refresh.