I call with the following code a MyView with RouterLink
RouterLink rl = new RouterLink(null, MyView.class);
How can i navigate to MyView when i want to give a Parameter to the (constructor) of MyView?
Is this possible with RouterLink?
I call with the following code a MyView with RouterLink
RouterLink rl = new RouterLink(null, MyView.class);
How can i navigate to MyView when i want to give a Parameter to the (constructor) of MyView?
Is this possible with RouterLink?
Hello hans-georg,
have you tried to use the following method?
/**
* Creates a new router link for the given navigation target using the given
* text and parameter.
*
* @param text
* link text
* @param navigationTarget
* navigation target
* @param parameter
* url parameter for navigation target
* @param <T>
* url parameter type
* @param <C>
* navigation target type
*/
public <T, C extends Component & HasUrlParameter<T>> RouterLink(String text,
Class<? extends C> navigationTarget, T parameter) {
this();
setText(text);
setRoute(getRouter(), navigationTarget, parameter);
}
Here you can find more information about [URL Parameters]
(https://vaadin.com/docs/v12/flow/routing/tutorial-router-url-parameters.html)