hideTab works fine in R Studio, but fails in Chrome

I am showing / hiding a tab based on an event - all works fine in RStudio with "run app", but in Chrome accessing using a url direct to our server I get console error:

Warning: Error in hideTab: could not find function "hideTab"

Is the RStudio test server different from the server I'm using when I use "run app" Do I have to update the server to same version or can I specify / load libraries in the R code.

Thanks very much for any pointers!

ui <- navbarPage(id="navbar", title="Analysis",
                 tabPanel(title="Home", id =p("here is main page"), checkboxInput("show_other_tab", "show other tab?", value=FALSE)),
                 tabPanel(title="My Data", value="mydata", p("some other text")))

server <- function(input, output, session){
  observe({
    if (input$show_other_tab) {
      showTab("navbar", target = "mydata")
    } else {
      hideTab("navbar", target = "mydata")
    }
  })
}

shinyApp(ui, server)

This topic was automatically closed 54 days after the last reply. New replies are no longer allowed.