You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We register our routes dinamically using the RouteConfiguration like this:
RouteConfiguration.forSessionScope()
.setRoute(
"home", //path
HomeView.class, //navigation target
MainLayout.class //one or more parents
);
The MainLayout.class view extends AppLayout.class.
When we start the application the components used in HomeView.class and not used in MainLayout.class are not displayed.
For example in HomeView.class we have a combo-box component but in MainLayout.class there is no combo-box. Then the combo-box is not displayed.
We managed to display all components properly with two differents workarounds:
Adding @uses annotations to MainLayout.class with all components.
or
With the option optimizeBundle=false the components
Is this behaviour normal? Which is the best solution? Is there another better solution?
I am not sure if this is the expected behaviour or is a bug. In any case, I think this should be explained in Vaadin documention, at least in "Registering Routes Dynamically" and the "Upgrading Guide"
Thanks in advance.
Expected behavior
When we use Vaadin 22 everything works fine, but we have upgraded v24 and now all components that are not used in parent view are not displayed as we expected.
Minimal reproducible example
The application should have this requirements:
Register routers dinamically
The views should use the AppLayout
There should be components used in children components and not used in the parent view.
Versions
Vaadin / Flow version: 24.1.2
Java version: 17
OS version: Windows 10
Browser version (if applicable): any browser
Application Server (if applicable): Spring Boot embedded Tomcat
IDE (if applicable): any IDE
Spring Boot: 3.1.1
The text was updated successfully, but these errors were encountered:
@jruizj74 could you please provide an example project reproducing the issue?
I tried the steps you posted, but I was unable to reproduce the problem.
The components used only in the runtime registered view were correctly loaded.
Where are you registering the routes? In a VaadinServiceInitListener? or in a view?
We have a View that extends RouteNotFoundError so when initally an user logins and a NotFoundException is thrown this view is loaded. In this view we do the following actions:
We get from Spring Security context a list of routes
We load this routes in route configuration
We forward to a default view
This code snippet shows this actions:
@permitAll @slf4j
public class ApplicationAccess extends RouteNotFoundError {
... @OverRide
public int setErrorParameter(BeforeEnterEvent event, ErrorParameter parameter) {
With regard to 'The components used only in the runtime registered view were correctly loaded.', when we watch the source code in the browser the components tags are empty, for example:
@jruizj74 you are loading the view by reflection, so it is expected that either @Uses or optimizeBundle=false are used,
because the byte code scanner cannot collect information about that class.
Description of the bug
We register our routes dinamically using the RouteConfiguration like this:
RouteConfiguration.forSessionScope()
.setRoute(
"home", //path
HomeView.class, //navigation target
MainLayout.class //one or more parents
);
The MainLayout.class view extends AppLayout.class.
When we start the application the components used in HomeView.class and not used in MainLayout.class are not displayed.
For example in HomeView.class we have a combo-box component but in MainLayout.class there is no combo-box. Then the combo-box is not displayed.
We managed to display all components properly with two differents workarounds:
or
Is this behaviour normal? Which is the best solution? Is there another better solution?
I am not sure if this is the expected behaviour or is a bug. In any case, I think this should be explained in Vaadin documention, at least in "Registering Routes Dynamically" and the "Upgrading Guide"
Thanks in advance.
Expected behavior
When we use Vaadin 22 everything works fine, but we have upgraded v24 and now all components that are not used in parent view are not displayed as we expected.
Minimal reproducible example
The application should have this requirements:
Versions
The text was updated successfully, but these errors were encountered: