hide_error_box: hide_error_box

Description Usage Arguments Examples

View source: R/error_box.R

Description

Hide an error box

Usage

1
hide_error_box(inputId)

Arguments

inputId

ID of the error box to hide

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
if (interactive()) {
  library(shiny)
  ui <- tagList(
    iceComponents::use_iceComponents(),
    iceComponents::container(
      iceComponents::page(
        tags$h2("My App"),
        iceComponents::error_box(
          inputId = "shiny-server-error"
        ),
        tags$button(
          id = "show",
          class = "shiny-bound-input action-button",
          "Do Something"
        ),
        tags$button(
          id = "hide",
          class = "shiny-bound-input action-button",
          "Hide Error"
        )
      )
    )
  )

  server <- function() {
    observeEvent(input$show, {
      iceComponents::show_error_box(
        inputId = "shiny-server-error",
        error = "Internal Server Error (500)"
      )
    })

    observeEvent(input$hide, {
      iceComponents::hide_error_box(
        inputId = "shiny-server-error"
      )
    })
  }

  shinyApp(ui, server)

}

InControlofEffects/iceComponents documentation built on April 1, 2021, 5:51 a.m.