So the last problem to solve is to make it look like a button.
But I guess I can figure that out myself.
Let me just wish you good luck ![]()
Would be nice if Matti could say something why It is not possible with UI::navigate and thanks for your help knoobie!
Just oversight I guess and once he reads all of this, he has probably implemented this in minutes and added to the 24.0 release
Just found this from you :
It is quite an old discussion ![]()
I know, you can find my name in this thread as well
there is also a ticket in web-components with discussions about link styled as button and vice versa
Ah, so I am still stuck.
The Link does not look like a button.
and the UI navigate cannot do what I want.
Maybe I should just wait for Matti ![]()
I’ll get back to this next week, but yeah, probably just missing API.
BTW. This might (or might not) be relevant, my recent opinionated post about implementing deep linkin to Vaadin views: Don't let deep linking code clutter your UI logic | Vaadin
TLDR: Might make sense to just use Java to move to the new view with appropriate state/parameters and then maintain the deep linking URL inside the view.
I tested your original attempt, and to me it seems to be enough for your use case and working fine. Maybe a thing that is not obvious is the order in which framework calls the methods. setParameter (receiving the url parameter) is called first and then in AfterNavigationObserver you can read queryparameters.
Did you @delightful-horse read the blog post? My guess is that the approach described there would be good for you, but can’t say for sure without knowing the big picture.
If you want to use “route templates” (the more complex HasUrlParameter thingie), together with query parameters, this is the way to go today:
String baseUrl = RouteConfiguration.forSessionScope().getUrl(getClass(), routeParameters);
QueryParameters queryParameters = QueryParameters.of(“queryparam”, “foo”);
UI.getCurrent().navigate(baseUrl + “?” +queryParameters.getQueryString());
Personal opinion: this looks horrible and implementing multiple interfaces on the view to handle both params sound DX wise really bad as well ![]()