How do I manage to link from a given shiny part to parts that are located on other tabs/panels?

Update
------

The solution I drafted below works for the explicit case of linking to tabs/panels (and that's what I asked for). 

**However, I'd be interested to also know about more generic ways of linking parts of a shiny app.**

Example
-------

I'd like to link from panel A to panel B, but I'm not quite sure what I need to specify as an action when the action link in panel A is clicked.

The value `#tab-4527-2` came from investigating the HTML output of `ui`, but I just saw that those values change each time I restart the app.

```
library(shiny)

# UI ---------------------------------------------------------------------

ui <- fluidPage(
  tabsetPanel(
    tabPanel(
      "A",
      p(),
      actionLink("link_to_tabpanel_b", "Link to panel B")
    ),
    tabPanel(
      "B",
      h3("Some information"),
      tags$li("Item 1"),
      tags$li("Item 2")
    )
  )
)

# Server ------------------------------------------------------------------

server <- function(input, output, session) {
  observeEvent(input$link_to_tabpanel_b, {
    tags$a(href = "#tab-4527-2")
  })
}

shinyApp(ui, server)

```
['https://Stackoverflow.com/questions/34315485', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/989691/']
We have just released a [routing library](https://github.com/Appsilon/shiny.router), which makes linking in Shiny easy. Here's how it looks like in a nutshell.

```
make_router(
   route("<your_app_url>/main",  main_page_shiny_ui),
   route("<your_app_url>/other", other_page_shiny_ui)
)

```

More information can be found in this [blog post](http://blog.appsilondatascience.com/rstats/2016/12/08/shiny.router.html).
According to the code and logic from Rappster. It is possible to set any kind of links. Link to `TabsetPanel` can be used by `updataTabsetPanel`. Link to `Navbar` can use `updateNavbarPage(session, inputId, selected = NULL)`. These can be found by `?updateTabsetPanel` as following. 

```
updateTabsetPanel(session, inputId, selected = NULL)

updateNavbarPage(session, inputId, selected = NULL)

updateNavlistPanel(session, inputId, selected = NULL)

```

Please notice `selected` is the new id that you can define for `tabsetPanel`, `Navbar`, or `NavlistPanel`.