0

So I have a chain of selectInput() that I need to render once we have the selection from the previous selectInput(). It seems to work fine, but the last one isn't render.

In my server.R file I have the following reactive expression and the renderUI expression:

  time_series_names <- reactive({
    req(input$ac, input$factor_type, input$sub_type1, cancelOutput = FALSE)
    #calls an external function to get choices for selectInput...never gets
    #called and I'm not sure why...
    tryCatch({get_names_of_factors(asset_class = input$ac,
                                   factor_type = input$factor_type,
                                   sub_type = input$sub_type1)},
             error = function(e){
               cat("Waiting on metadata to be selected...\n")
               NULL
             })
    })

  output$selectTimeSeries <- renderUI({
    browser()
    req(input$ac, input$factor_type, input$sub_type1, cancelOutput = FALSE)
    selectInput("var",
                label = "Time Series",
                choices = time_series_names(),
                multiple = TRUE)
    })

So you can see the chain of three input$... required but I'm not sure why I can't get the output$selectTimeSeries to render with uiOutput once I have everything selected. I thought since time_series_name() is reactive it would trigger the renderUI expression? I did make sure to write uiOutput("selectTimeSeries") correctly in my ui.R file.

Lorenzo M
  • 88
  • 7
  • Hi Lorenzo, in the current format, it is difficult to answer your question. Please consider adding a reproducible example. For tips on how to do that, see e.g. [here](https://stackoverflow.com/questions/48343080/how-to-convert-a-shiny-app-consisting-of-multiple-files-into-an-easily-shareable/48343110#48343110) – Florian Nov 29 '18 at 06:50

1 Answers1

0

Sorry for the bad question, I had a req(input$sub_type1) but that reactive value didn't exist (was supposed to be req(input$sub_type)).

Lorenzo M
  • 88
  • 7