The inputs from the UI module will then be linked to the server logic in your downloadObj funciton, provided you created an ns <- NS(id) variable in your UI function and wrapped inputs/outputs in the ns() function.
In your case:
downloadObjUI <- function(id, ...) {
ns <- NS(id)
downloadButton(n("data_download"), label = "Download Data")
}
Will link to something like this in downloadObj:
downloadObj <- function(input, output, session, ...) {
output$chart_download <- downloadHandler(
filename = function() {
paste("data-", Sys.Date(), ".csv", sep="")
},
content = function(file) {
write.csv(data, file)
}
)
}
So if you have a UI and accompanying server module setup like so, you can call the UI function within your UI code:
downloadObjUI(id = "download1", ...)
# '...' denoting anythng else you need to pass to the module
Then in your server you call the server side module and pass the same id that you gave the UI module:
callModule(downloadObj, id = "download1", ...)
Let me know if that helps!