flow
flow copied to clipboard
get query parameters at any point
Describe your motivation
Currently there is no API which can return query parameters of current page url, or there is also not any API which returns current url path. There is a way to get query parameters but it needs event (e.g. beforeEvent), but there is no any method for which event is not required.
Describe the solution you'd like
Provide an API which returns at least query parameters, or whole url path. In vaadin 14
Couldn't you use UI.getActiveViewLocation()
?
I am on Vaadin 14 and there is no getActiveViewLocation method in UI
Yeah, this API wasn't picked to Vaadin 14 from Vaadin 24, but you can try UI.getInternals().getActiveViewLocation().getQueryParameters()
, which should be already in Vaadin 14 for years.
I tried it but, it doesn't work properly, mostly it worked first time but later when I switched between views it didn't work.