title: R shiny Observe running Before loading of UI and this causes Null parameters
body: <p>I am running into an issue because observe is being called first before the UI loads.</p>
  
  <p>Here is my ui.R</p>
  
  <pre><code>  sidebarPanel(
      selectInput("Desk", "Desk:" ,  as.matrix(getDesksUI())),
      uiOutput("choose_Product"), #this is dynamically created UI
      uiOutput("choose_File1"), #this is dynamically created UI
      uiOutput("choose_Term1"), #this is dynamically created UI  ....
  </code></pre>
  
  <p>Here is my Server.R</p>
  
  <pre><code>shinyServer(function(input, output,session) {
  
    #this is dynamic UI
    output$choose_Product &lt;- renderUI({ 
      selectInput("Product", "Product:", as.list(getProductUI(input$Desk)))
    })
  
     #this is dynamic UI
    output$choose_File1 &lt;- renderUI({
      selectInput("File1", "File 1:", as.list(getFileUI(input$Desk, input$Product)))
    })
  
    #this is dynamic UI and I want it to run before the Observe function so the call
    # to getTerm1UI(input$Desk, input$Product, input$File1) has non-null parameters
    output$choose_Term1 &lt;- renderUI({
      print("Rendering UI for TERM")
      print(paste(input$Desk," ", input$Product, " ", input$File1,sep=""))
      selectInput("Term1", "Term:", getTerm1UI(input$Desk, input$Product, input$File1))
    })
  </code></pre>
  
  <p>This is my observe function and it runs before the input$Product and input$File1 are populated so I get an error because they are both NULL.  But I need to use the input from the UI.  </p>
  
  <pre><code>   observe({ 
      print("in observe")
      print(input$Product)
      max_plots&lt;-length(getTerm2UI(input$Desk, input$Product, input$File1))
      #max_plots&lt;-5
              # Call renderPlot for each one. Plots are only actually generated when they
              # are visible on the web page.
              for (i in 1:max_plots )   {
                # Need local so that each item gets its own number. Without it, the value
                # of i in the renderPlot() will be the same across all instances, because
                # of when the expression is evaluated.
                local({
                 my_i &lt;- i
                  plotname &lt;- paste("plot", my_i, sep="")
                  output[[plotname]] &lt;- renderPlot({
                    plot(1:my_i, 1:my_i,
                         xlim = c(1, max_plots ),
                         ylim = c(1, max_plots ),
                          main = paste("1:", my_i, ". n is ", input$n, sep = "") )
                  })
                })
              }##### End FoR Loop
   },priority = -1000)
  </code></pre>
  
  <p>Any idea how to get the input$Product and input$File1 to be populated BEFORE observe runs? </p>
  
  <p>Thank you.</p>