title: UpdateSelectInput Not Working in Shiny Module
body: <p>I am building a shiny app that is essentially a dashboard with many different pages. Each page contains a graph, and controls to filter the graph by year etc. These filters are selectInputs, and some filters rely on others. That is, there's a filter for a category, and for various subcategories. I would like to be able to update the filter such that when you select a category, only the relevant subcategories are available to be selected in the next filter. I am trying to modularize my code by making each page of the dashboard its own module. My code worked before modularizing, but now that I have pages separated into modules, the updateSelectInput no longer works.</p>
  <p>Here is an example of what I am trying to do. This is what the module looks like:</p>
  <p>This is the First page:</p>
  <pre><code>Updater_ModuleUI &lt;- function(id, label = NULL){
    ns = NS(id)
    tagList(
      sidebarLayout(
        sidebarPanel(
          selectInput(ns(&quot;Category&quot;), label = &quot;Category&quot;,
                      choices = unique(CategoriesMap$Category),
                      multiple = TRUE),
          selectInput(ns(&quot;SubCategory&quot;), label = &quot;SubCategory&quot;,
                      choices = unique(CategoriesMap$SubCategory),
                      multiple = TRUE)
        ),
        mainPanel()
      )
    )
  }
  Updater_ModuleServer &lt;- function(id) {
    moduleServer(id,
                 function(input, output, session){
                   observe({
                     if (!is.null(input$Category)){
                       x &lt;- filter(CategoriesMap, Category == input$Category)
                       updateSelectInput(inputId = &quot;SubCategory&quot;, label = &quot;SubCategory&quot;,
                                         choices = x$SubCategory)
                     }
                   })
                 }
    )
  }
  </code></pre>
  <p>Then this is the second page (Here it's the exact same thing as the first page just with a different name). This is the page on which the updating stops working.</p>
  <pre><code>Updater1_ModuleUI &lt;- function(id, label = NULL){
    ns = NS(id)
    tagList(
      sidebarLayout(
        sidebarPanel(
          selectInput(ns(&quot;Category&quot;), label = &quot;Category&quot;,
                      choices = unique(CategoriesMap$Category),
                      multiple = TRUE),
          selectInput(ns(&quot;SubCategory&quot;), label = &quot;SubCategory&quot;,
                      choices = unique(CategoriesMap$SubCategory),
                      multiple = TRUE)
        ),
        mainPanel()
      )
    )
  }
  Updater1_ModuleServer &lt;- function(id) {
    moduleServer(id,
                 function(input, output, session){
                   observe({
                     if (!is.null(input$Category)){
                       x &lt;- filter(CategoriesMap, Category == input$Category)
                       updateSelectInput(inputId = &quot;SubCategory&quot;, label = &quot;SubCategory&quot;,
                                         choices = x$SubCategory)
                     }
                   })
                 }
    )
  }
  </code></pre>
  <p>Then the main app looks like:</p>
  <pre><code>CategoriesMap &lt;- as.data.frame(rbind(
    c(&quot;Category 1&quot;, &quot;SubCategory 1&quot;),
    c(&quot;Category 1&quot;, &quot;SubCategory 2&quot;),
    c(&quot;Category 2&quot;, &quot;SubCategory 3&quot;),
    c(&quot;Category 2&quot;, &quot;SubCategory 4&quot;)))
  colnames(CategoriesMap) &lt;- c(&quot;Category&quot;, &quot;SubCategory&quot;)
  
  ui &lt;- navbarPage(&quot;Ref20 Checker&quot;, id = &quot;page&quot;,
                   tabPanel(&quot;Page 1&quot;,
                            Updater_ModuleUI(&quot;update&quot;)
                            ),
                   tabPanel(&quot;Page 2&quot;,
                            Updater1_ModuleUI(&quot;update 2&quot;)
                            )
  )
  
  server &lt;- function(input, output, session) {
    Updater_ModuleServer(&quot;update&quot;)
    Updater1_ModuleServer(&quot;update 2&quot;)
  }
  
  shinyApp(ui, server)
  </code></pre>
  <p>In my app I have many modules that each are different tabPanels. Each module is essentially the same, but differs in some relatively small way, but has the same inputs and the same updating needed. The strange thing is that this exact same code works for one page, but not for any other pages. I suspect that it is not namespaced properly or something like that. Any help would be appreciated!</p>