I want to show the save status in the button by changing its label and icon.
I am using a downloadButton to allow the user to specify the location and file name. The report is an officer word document saved using print(obj, target).
The expected flow is:
* user clicks button
* button changes to "Saving..."
* file dialogue opens
* user selects file name/location
* r attempts to save the document
* if the save is successful (i.e., no errors)the button changes to "Saved"
* otherwise, button changes to "Save Failed"
The actual flow is:
* user clicks button
* button changes to "Saving..."
* file dialogue opens
* button changes to "Saved"
* user selects file name/location
* ...
The script does not wait for the user to select the file or see if the file saves correctly before changing the status to "Saved." In this case, the file is saving correctly, but the script has no way of knowing that before it prints to target, and it cannot print to target until the user provides the file name/location.
How may I revise this so that the status change is related to whether or not the file was saved without error?
library(shiny)
library(shinyjs)
library(officer)
ui
0 comments:
Post a Comment
Thanks