js <- "Shiny.addCustomMessageHandler('reset', function(message) { $('#file').val(''); $('#file').trigger('change');})" runApp(shinyApp( ui = fluidPage( tags$head(tags$script(HTML(js))), fileInput("file", "File"), actionButton("show", "Show value"), actionButton("reset", "Reset") ), server = function(input, output, session) { observeEvent(input$show, cat(str(input$file), "\n")) observeEvent(input$reset, session$sendCustomMessage("reset", list())) }))
--
You received this message because you are subscribed to the Google Groups "Shiny - Web Framework for R" group.
To unsubscribe from this group and stop receiving emails from it, send an email to shiny-discus...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/shiny-discuss/6ce56151-58fc-43d7-89dd-34016344880c%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.