I have created a Shiny app with navbarPage having 3 tabs namely 'A1', 'A2', & 'A3'. Now I wanted to create a modal-dialogbox when user select 'A2'. Below is my code:
ui <- shinyUI(fluidPage(
wellPanel(
navbarPage(id = "AC", "AC :",
tabPanel(tabName = "A1", h6("A1"), fluidRow()),
tabPanel(tabName = "A2", h6("A2"), fluidRow()),
tabPanel(tabName = "A3", h6("A3"), fluidRow())
)
)
))
server <- function(input, output, session) {
observe({
if (input$AC == "A2") {
showModal(modalDialog(
title = "Important message",
div(id = "aa", style = "width: 1100px; height: 100px;", HTML("<b>This is </b>an important message!")),
easyClose = TRUE
))
}
})
}
shinyApp(ui, server)
However, above App doesn't open a modal-dialogbox when 2nd Tab is selected. Any pointer to the right approach will be highly appreciated.
Thanks,