I want two different events to trigger an observer. It was suggested here that this should work. But it seems that it depends only on the second event.
obser
This should do it, note that you still have to check if the buttons were clicked as mentioned by @MrFlick
#rm(list = ls())
library(shiny)
ui <- shinyUI(bootstrapPage(
actionButton("test1", "test1"),
actionButton("test2", "test2"))
)
server <- shinyServer(function(input, output) {
toListen <- reactive({
list(input$test1,input$test2)
})
observeEvent(toListen(), {
if(input$test1==0 && input$test2==0){
return()
}
print('Hello World')
})
})
shinyApp(ui, server)
#rm(list = ls())
library(shiny)
ui <- shinyUI(bootstrapPage(
actionButton("test1", "test1"),
actionButton("test2", "test2"))
)
server <- shinyServer(function(input, output) {
observeEvent(input$test1 | input$test2, {
if(input$test1==0 && input$test2==0){
return()
}
print('Hello World')
})
})
shinyApp(ui, server)