I still have updated problem as described at How to listen for more than one event expression within a Shiny eventReactive handler.
There were two separate actionButton responding to different observeEvent. The values from observeEvent will be sent to UI.
Although i try the above method, there were still many errors. The two actionButton could not be run independently.
For example:
#rm(list = ls())
library(shiny)
ui <- shinyUI(bootstrapPage(
column(12,align="center", div(textOutput('txfg'),style = "font-size:18px")),
br(),
actionButton("test1", "test1"),
actionButton("test2", "test2"))
)
server <- shinyServer(function(input, output) {
toListen <- reactive({
list(input$test1,input$test2)
})
observeEvent(toListen(), {
################## two different observeEvent
if(input$test1==0 && input$test2==0){
return()
}
if(input$test1==1)
{ outputTest <- 'Hello World'}
if(input$test2==1)
{ outputTest <-'World Hello'}
})
##################
output$txfg <- renderText(outputTest)
})
shinyApp(ui, server)