Quantcast
Channel: Active questions tagged r - Stack Overflow
Viewing all articles
Browse latest Browse all 206305

Get additional named attributes from actionButton in r Shiny

$
0
0

I found out that is possible to add additional arguments to an actionButton. Now what i would like to know how to retrieve this additional argument inside an observeEvent.

library(shiny)

  ui <- fluidPage(
    actionButton("goButton", "Go", value = 10)
  )

  server <- function(input, output, session) {

    observeEvent(input$goButton,{
      # print value argument of the action Button - should in that case always print 10
    })
  }

  shinyApp(ui, server)

Many thanks!


Viewing all articles
Browse latest Browse all 206305

Trending Articles