Package com.vaadin.flow.router
Annotation Interface DynamicPageTitle
Resolves the page title of a navigation target dynamically through a
PageTitleGenerator, without creating an instance of the navigation
target.
This is the instance-free counterpart of HasDynamicTitle: the title
is resolved purely from the navigation target class and its route parameters,
which makes it usable for routes that are not (and should not be)
instantiated, such as the entries of a breadcrumb trail or a menu.
@Route("products/:productId")
@DynamicPageTitle(ProductTitleGenerator.class)
public class ProductView extends Div {
// ...
}
A PageTitle value may be declared alongside this annotation; it is
then handed to the generator through PageTitleContext.value() (for
example as an i18n message key) rather than used as the title directly.- Since:
- 25.2
- Author:
- Vaadin Ltd
-
Required Element Summary
Required ElementsModifier and TypeRequired ElementDescriptionClass<? extends PageTitleGenerator> Gets thePageTitleGeneratortype used to resolve the title.
-
Element Details
-
value
Class<? extends PageTitleGenerator> valueGets thePageTitleGeneratortype used to resolve the title.- Returns:
- the generator type, not
null
-