You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Sometimes a downloadButton may take a little while to prepare its contents (e.g., if you're downloading a shapefile, you may need to write it to a temp directory, zip that file, and then download that zipped file) and I wouldn't want a user to hammer the download button over and over.
So, my question is - is there an equivalent for shiny::downloadButton() on the horizon?
Or is there already a way to link up input_task_button() to a download manager?
Cheers!
The text was updated successfully, but these errors were encountered:
This would be a good fit for the "v2 API" I've proposed in #1077. I think it might be relatively easy to implement, but for backwards compatibility reasons it'd be much easier to do in a new function
In the context of using input_task_button with ExtendedTask, I used the following workaround:
In the UI, create an invisible shiny::downloadButton (this would be the trigger for the download action after all the ExtendedTask work has completed), for the example assign it the id of download_trigger. To make it invisible, you have the option of using the BS5 utility class for visibility, or wrap the shiny::downloadButton in a div with zero height.
In the UI, create a (visible) input_task_button, this is what the user would click on.
In the Server, create your ExtendedTask object ($new()), and bind to your input_task_button.
In the Server, in the observeEvent handler for the input_task_button, $invoke() on the ExtendedTask object created in step 3.
In the Server, create an observeEvent for the $status() of the ExtendedTask object created in step 3.
If the $success() of your ExtendedTask object TRUE, then "programmatically click" on the invisible shiny::downloadButton created in step 1 by calling shinyjs::click('download_trigger').
Note that in the downloadHandler for your invisible shiny::downloadButton button, you pass the $result() of your ExtendedTask object as the data for download.
Hello,
Big fan of
input_task_button()
Sometimes a downloadButton may take a little while to prepare its contents (e.g., if you're downloading a shapefile, you may need to write it to a temp directory, zip that file, and then download that zipped file) and I wouldn't want a user to hammer the download button over and over.
So, my question is - is there an equivalent for
shiny::downloadButton()
on the horizon?Or is there already a way to link up
input_task_button()
to a download manager?Cheers!
The text was updated successfully, but these errors were encountered: