Link Forwarding with "memory" of which link was clicked?

Hello, I envision a very simple 2 page app. Page 1 contains a simple data_table, like this

Where the links all point to the second page, which will, for example purposes, simply show which link was clicked (in reality, of course, we want to do something more complex)

  1. Is such a strategy possible?
  2. Is the strategy as simple as ‘/page2’ for the URL?
  3. What is the best practice for the new page “remembering”/“knowing” what corresponding value was clicked?
  4. Is there a strategy to make opening a new tab the default action?

Thank you!

Hi @rictuar you might look into this:

1- Multi-Page Apps and URL Support | Dash for Python Documentation | Plotly
3- What came into my head, is the use of a dcc.Store(), but there might be simpler solutions
4- Open a Link on a New Tab

HI @rictuar

As @AIMPED mentioned, multi-page apps work well for this use case.

You can find a minimal example here GitHub - AnnMarieW/dash-multi-page-app-demos: Minimal examples of multi-page apps using the pages feature in dash>=2.5.1

In this example, the links are in a table (but they don’t have to be). Each link goes to the same page and passes a variable , (the stock) in the url to the layout function. This let’s you know which link was clicked and it can be used to show a different layout depending on which link was clicked on.

table_links

2 Likes