vaadin / vaadin/framework

Navigator.navigateTo() should support query parameters

Open
#11,060 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement
Dominant language
Java
Stars
1.8k
Forks
717
Avg merge
2d 6h
Merged PRs (30d)
3

Description

Vaadin 8.4.5. Currently, telling Navigator to navigate to my?foo=bar will fail with

java.lang.IllegalArgumentException: Trying to navigate to an unknown state 'my?foo=bar' and an error view provider not present
	at com.vaadin.navigator.Navigator.navigateTo(Navigator.java:661)

However, telling the browser to navigate to http://localhost:8080/my?foo=bar works and the foo query parameter is correctly shown in the query parameters as retrieved via Page.getCurrent().getLocation().getQuery().

Attempting to workaround this issue by navigating to my/?foo=bar will incorrectly add the ?foo=bar as a ViewChangeEvent.getParameters().

Please find the example application attached.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start at Navigator.java:661 and reproduce the failure with navigateTo("my?foo=bar"). Trace how the target state and query are parsed, then verify that the query is available through Page.getCurrent().getLocation().getQuery() without being included in ViewChangeEvent.getParameters().

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
api, web-dev
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.