Annotation Interface RouteParent
This is a purely logical hierarchy used to build navigation aids such as
breadcrumb trails and hierarchical menus. It is independent of the layout
chain declared through Route.layout() and RoutePrefix: a
route may be rendered inside one layout while logically belonging under a
completely different route.
The parent can be defined either as a static value() or, when it
needs to be computed, through a resolver(). Both are resolved
without creating an instance of the route or its parent, which makes them
usable for routes that are not currently shown, such as the ancestors of a
breadcrumb trail.
- Since:
- 25.2
- Author:
- Vaadin Ltd
-
Optional Element Summary
Optional ElementsModifier and TypeOptional ElementDescriptionClass<? extends RouteParentResolver> Gets theRouteParentResolverthat resolves the logical parent dynamically without requiring an instance of the route or its parent.Gets the static logical parent navigation target.
-
Element Details
-
value
Gets the static logical parent navigation target.The parent inherits the
RouteParametersof the annotated route, narrowed to the names the parent's own route template declares (so a parent with fewer or no parameters still resolves to a working link). Use aresolver()when the parent or its parameters need to be computed differently.Ignored when a
resolver()is set. Defaults toComponentitself, which marks "no static parent".- Returns:
- the logical parent navigation target, or
Componentwhen no static parent is used
- Default:
com.vaadin.flow.component.Component.class
-
resolver
Class<? extends RouteParentResolver> resolverGets theRouteParentResolverthat resolves the logical parent dynamically without requiring an instance of the route or its parent.When set to a resolver other than the default
RouteParentResolvermarker, the resolver is used to resolve the parent andvalue()is ignored. This allows the parent to be computed from the route parameters even for routes that are not instantiated.- Returns:
- the resolver type, or
RouteParentResolveritself when no resolver is used
- Default:
com.vaadin.flow.router.RouteParentResolver.class
-