I would like to save the output result (TRUE/FALSE) of a shinyalert warning (https://github.com/daattali/shinyalert). This post is helpful for printing the value to console (How to capture shinyalert input field as variable), but I am unable to save the value itself as a variable.
library(shiny)
library(shinyalert)
ui <- fluidPage(
useShinyalert()
)
server <- function(input, output) {
shinyalert(
title = "Warning",
text = "Some warning",
closeOnEsc = FALSE,
closeOnClickOutside = FALSE,
type = "warning",
showConfirmButton = TRUE,
showCancelButton = TRUE,
confirmButtonText = "OK",
cancelButtonText = "Cancel",
animation = TRUE,
callbackR = mycallback
)
}
shinyApp(ui, server)
This will automatically print to console the value of the shinyalert. Setting the shinyalert as a variable or the value in a function does not seem to do anything:
mycallback <- function(value) {
test_var=value
}