0
votes

I have a Shiny app where there are two tabPanels in a tabsetPanel. The widgets in the tabPanels are dynamically created based on values in a data frame (called stager) that is loaded from mySQL. The input values (selected) for the second tabPanel checkbox are only initialized when the the tab is clicked on but I want them initialized when the Shiny app is run. The server and UI code is below:

Server code (2nd tabPanel):

  output$Box4 = renderUI(checkboxGroupInput('showcols',
                                            'Columns to show:',
                                            names(stager2()),
                                            selected = names(stager2()[c(1,6,10,11,14,15,18,19,20)])))

UI code (2nd tabPanel):

  tabPanel("Select Columns", 
           hr(),
           uiOutput("Box4")
  )

Any ideas on how to get the input values to initialize when the app is run are much appreciated.

1

1 Answers

0
votes

Have you played around with the observe function at all?

http://shiny.rstudio.com/reference/shiny/latest/observe.html

I haven't personally used it for that sort of thing, but it may be helpful.