-
Does this work? I.e. change the URL and get the changes
enableBookmarking("url") sources <- c("ECDC", "JHU", "JHU_US") get_countries <- function(source = "ECDC") { switch(source, "ECDC" = c("Spain", "Switzerland"), "JHU" = c("USA", "Australia"), "JHU_US" = c("Alabama", "Florida")) } shinyApp( ui = function(req) { fluidPage( textInput("txt", "Text"), checkboxInput("chk", "Checkbox"), selectInput("source", "Choose a data source:", sources), uiOutput("country_input") ) }, server = function(input, output, session) { output$country_input <- renderUI({ selectInput("country_output", "Choose a country or region:", # selected = "Switzerland", get_countries(input$source)) }) observe({ # Trigger this observer every time an input changes reactiveValuesToList(input) session$doBookmark() }) onBookmarked(function(url) { updateQueryString(url) }) } )
-
I found the information presented here to be remarkably useful, providing practical tips that I can easily apply in my life. @ Retro bowl
Please register or sign in to comment