title: lapply in return Shiny Module
body: <p>I have the list of variables and some more stuffs. When I submit the information from the user, I used <code>lapply</code> to apply the module <code>updateServer</code>. Inside the module the user is able to edit the information, and it will save after the user click <code>update button</code>. The module return a dataframe.</p>
  <p>How I can return the list of dataframes in the server after I call the Module?</p>
  <p><strong>MODULE</strong> <em>return dt</em></p>
  <pre><code>
  # Module
  updateUI &lt;- function(id){
      ns &lt;- NS(id)
      tagList(
          uiOutput(ns(&quot;title_out&quot;)),
          uiOutput(ns(&quot;x_label_out&quot;)),
          uiOutput(ns(&quot;y_label_out&quot;)),
          uiOutput(ns(&quot;sb_edit&quot;))
      )
  }
  updateServer &lt;- function(input, output, session, title_plot) {
      ns &lt;- session$ns
      values &lt;- reactiveValues(title = &quot;&quot;,x_label = &quot;&quot;, y_label = &quot;&quot;)
      
      output$title_out &lt;- renderUI({
          textInput(ns(&quot;title&quot;), &quot;Title&quot;, value = paste0(&quot;This is a title for &quot;,title_plot))
      })
      
      
      output$x_label_out &lt;- renderUI({
          textInput(ns(&quot;x_label&quot;),&quot;X Label&quot;, value = &quot;&quot;)
      })
      
      
      output$y_label_out &lt;- renderUI({
          textInput(ns(&quot;y_label&quot;), &quot;Y Label&quot;, value = &quot;&quot;)
      })
      
      output$sb_edit &lt;- renderUI({
          actionButton(ns(&quot;update&quot;), &quot;Update&quot;)
      })
      
      
      observeEvent(input$update,{
          values$title &lt;- input$title 
          values$x_label &lt;- input$x_label 
          values$y_label &lt;- input$y_label 
      })
      
      dt &lt;- reactive({
          dt &lt;- data.frame(title = values$title, x_label = values$x_label, y_label = values$y_label)
      })
      
      return(list(dt = dt()))
  }
  
  </code></pre>
  <p><strong>SERVER</strong></p>
  <pre><code>
  library(shiny)
  # server
  shinyServer(function(input, output) {
      
      var &lt;- eventReactive(input$sb,{
          input$var 
      })
      
      handlers &lt;- list()
      
      observe({
          handlers &lt;&lt;- lapply(var(), function(i){callModule(updateServer, paste0(&quot;test_&quot;,i), i) })
      })
      
      output$ui_out &lt;- renderUI({
          lapply(var(), function(i){
              tagList(updateUI(paste0(&quot;test_&quot;,i)))
          })
      })
      
      
      # Return the list here
      output$out &lt;- renderText({ ## 7
          req(length(handlers) &gt; 0)
          out &lt;- lapply(handlers, function(h) h$dt())
      }) 
  })
  </code></pre>
  <p><strong>UI</strong></p>
  <pre><code># ui
  
  library(shiny)
  
  shinyUI(fluidPage(
      sidebarLayout(
          sidebarPanel(
              tagList(
              selectInput(&quot;var&quot;, &quot;Variables for Plot&quot;,choices = names(mtcars), selected = names(mtcars)[1:3], multiple = T),
              actionButton(&quot;sb&quot;, &quot;Submit&quot;)
              )
          ),
  
          mainPanel(
              uiOutput(&quot;ui_out&quot;),
              verbatimTextOutput(&quot;out&quot;)
          )
      )
  ))
  
  
  </code></pre>