selectFileUI: Module UI function for file selection

View source: R/selectFileModule.r

selectFileUIR Documentation

Module UI function for file selection

Description

Module UI function for file selection

Usage

selectFileUI(id, label = "Select file", title = "", multiple = FALSE)

Arguments

id

string namespace id for module (same as in server)

label

text to appear on select file button eg "Select file"

title

text title for button (not used) default ""

multiple

TRUE for allowing mutiple selection, default FALSE to select single file

Details

Select File Module UI used with selectFileServer modified from https://stackoverflow.com/questions/38747129/how-to-use-shinyfiles-package-within-shiny-modules-namespace-issue

Value

datapath path of selected file ( relative to root_dirs argument in fileSelectServer)

Examples

#simple file selection shiny app
library(shiny)
ui <-   fluidPage(
 selectFileUI(
   id = "fileSelect1",label ="Select File"
 ),
 textOutput("datapath")

)

server <- function(input, output, session) {
 rv<-reactiveValues()
 x <- selectFileServer(id = "fileSelect1")
 observe(rv$datapath<-x$datapath)
 observe(output$datapath<-renderText(rv$datapath))


}
shinyApp(ui,server)

nevilamos/FAMEFMR documentation built on April 17, 2025, 9:32 p.m.