I’m trying to create a UI with two dropdown fields referencing data frames in the global environment–mon and apps. I’m using selectizeInput to do this. I click an actionButton (ID=”do”) to send the input variables to the server.
I added a browser statement to step through the server code, but it never steps through observeEvent block, and so it doesn’t pick any input variables before jumping into the proc function.
Hoping someone can help spot what I’m doing wrong.
#shiny app
ui <- fluidPage(
titlePanel(“Utilization”),
sidebarLayout(
sidebarPanel(
width = 2,
p("Select a month and application, then click Submit"),
selectizeInput(inputId = "month", label = NULL, choices = mon$Month, selected = NULL, multiple = FALSE, options = NULL),
selectizeInput(inputId = "apps", label = NULL, choices = apps$Apps, selected = NULL, multiple = FALSE, options = NULL),
actionButton("do", "Submit")
),
mainPanel(
plotOutput(outputId = "plot", height = '900px')
)
)
)
server <- function(input, output) {
browser()
observeEvent(input$do, {
x1 <- input$mon
x2 <- input$apps
output$plot <- renderPlot({
proc(x1, x2)
})
})
}
shinyApp(ui = ui, server = server)