So I\'m trying to make a shiny app where I have a button which only shows up if files have been uploaded; for this im using conditionalPanel.
ui.R:
r
You have to make a reactive output returning the status of the uploading and set the option suspendWhenHidden
of this output to FALSE
.
More precisely, in server.R you surely have a reactive function, say getData()
to make a dataframe from the uploaded file. Then do this:
getData <- reactive({
if(is.null(input$files)) return(NULL)
......
})
output$fileUploaded <- reactive({
return(!is.null(getData()))
})
outputOptions(output, 'fileUploaded', suspendWhenHidden=FALSE)
And in ui.R you can use conditionalPanel()
by doing:
conditionalPanel("output.fileUploaded",
......