title: shiny module namespace issue with dynamic creation of tabesetPanel
body: <p>I am currently having troubles making my module UI and server communicating whith an intermediate renderUI creating the layout. Here is a repex with and without the dynamic creation of the tabsetPanel. I guess the problem comes from namespace but I cannot figure out where and how to fix it.
  DO NOT WORK :</p>
  <pre><code>mod_graphical_general_ui &lt;- function(id){
    ns &lt;- NS(id)
    tagList(
      selectInput(ns(&quot;myselect&quot;), &quot;Select a choice&quot;, choices = NULL)
  )}
  
  mod_graphical_general_server &lt;- function(id, choices = NULL) {
    moduleServer( id, function(input, output, session){
      ns &lt;- session$ns
      updateSelectInput(session, &quot;myselect&quot;, choices = choices)
      
    })
  }
  
  ui &lt;- bootstrapPage(
    uiOutput(&quot;mytabs&quot;)
  )
  
  server &lt;- function(input, output) {
    mod_graphical_general_server(&quot;mymodule&quot;, choices = c(&quot;aaa&quot;, &quot;bbb&quot;))
    
    output$mytabs = renderUI({
      number_of_tabs &lt;- 3
      names_tab &lt;- paste0(&quot;Tab&quot;, 1:number_of_tabs)
      myTabs = lapply(1: number_of_tabs, function(x) {tabPanel(names_tab[[x]], div(uiOutput(paste0(&quot;graphics_tab&quot;, x))))})
      do.call(tabsetPanel, c(myTabs))
    })
    
    output$graphics_tab1 &lt;- renderUI({
      return(mod_graphical_general_ui(&quot;mymodule&quot;))
    })
  }
  
  shinyApp(ui = ui, server = server)
  </code></pre>
  <p>If I remove the step from calling the tabsetPanel, the code works .</p>
  <pre><code>mod_graphical_general_ui &lt;- function(id){
    ns &lt;- NS(id)
    tagList(
      selectInput(ns(&quot;myselect&quot;), &quot;Select a choice&quot;, choices = NULL)
  )}
  
  mod_graphical_general_server &lt;- function(id, choices = NULL) {
    moduleServer( id, function(input, output, session){
      ns &lt;- session$ns
      updateSelectInput(session, &quot;myselect&quot;, choices = choices)
      
    })
  }
  
  ui &lt;- bootstrapPage(
    #uiOutput(&quot;mytabs&quot;)
    uiOutput(&quot;graphics_tab1&quot;)
  )
  
  server &lt;- function(input, output) {
    mod_graphical_general_server(&quot;mymodule&quot;, choices = c(&quot;aaa&quot;, &quot;bbb&quot;))
    
    output$mytabs = renderUI({
      number_of_tabs &lt;- 3
      names_tab &lt;- paste0(&quot;Tab&quot;, 1:number_of_tabs)
      myTabs = lapply(1: number_of_tabs, function(x) {tabPanel(names_tab[[x]], div(uiOutput(paste0(&quot;graphics_tab&quot;, x))))})
      do.call(tabsetPanel, c(myTabs))
    })
    
    output$graphics_tab1 &lt;- renderUI({
      return(mod_graphical_general_ui(&quot;mymodule&quot;))
    })
  }
  
  shinyApp(ui = ui, server = server)
  </code></pre>
  <p>I already have asked the question in the community rstudio but with no luck.</p>