View source: R/error_sum_update.R
| error_summary_update | R Documentation |
This function changes the text that displays in the error summary box.
Requires shinyjs::useShinyjs() to work.
error_summary_update(inputId, error_list)
inputId |
The input Id of the error summary you want to update |
error_list |
An updated list of text values to be displayed in the error body |
an update error summary box
Other Govstyle errors:
error_off(),
error_on(),
error_summary()
ui <- shiny::fluidPage(
shinyjs::useShinyjs(),
shinyGovstyle::header(
org_name = "Example",
service_name = "User Examples",
logo = "shinyGovstyle/images/moj_logo.png"
),
shinyGovstyle::gov_layout(
size = "two-thirds",
error_summary(
inputId = "errorId",
error_title = "Error title",
error_list = c("error item1", "error item2")
)
),
shinyGovstyle::button_Input("btn1", "Change error summary"),
shinyGovstyle::footer(full = TRUE)
)
server <- function(input, output, session) {
shiny::observeEvent(input$btn1, {
error_summary_update(
"errorId",
c("error item1", "error item2", "error item3")
)
},
ignoreInit = TRUE
)
}
if (interactive()) shinyApp(ui = ui, server = server)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.