I have a checkboxGroupInput that should only be shown if a specific radioButton "continent" is selected. I tried to use conditionalPanel, but it doesn't work, it never shows the checkboxes , whichever radio button you choose.
This is my code, I don't understand what the problem could be ...
app.r
tabItem( tabName = "3dGlobe",
fluidRow(
column( width = 4,
box(
radioButtons("filters", "Filters" , choiceNames = list("All","Some continents") , choiceValues = list("all","continent")),
conditionalPanel(
condition = "input.filters == 'continent'",
uiOutput("continentCheckbox")
)
)
),
column( width = 1,
globeOutput("globe", width = "500px" , height = "500px")
)
)
)
In "server.r" i do this:
output$continentCheckbox <- renderUI({
checkboxGroupInput("continent", "choce continent:",choices = c("Europe", "Asia", "Africa"))
})
EDIT: this is a minimal app code:
library(shiny)
library(shinydashboard)
ui <- dashboardPage(
dashboardHeader(title = "FlightAnalyzer"),
dashboardSidebar(
sidebarMenu(
menuItem("conPanelTest", tabName = "3dGlobe", icon = icon("globe"))
)
),
dashboardBody(
tabItems(
tabItem( tabName = "3dGlobe",
fluidRow(
column( width = 4,
radioButtons("filters", "Filters" , choiceNames = list("All","Some continents") , choiceValues = list("all","continent")),
conditionalPanel(
condition = "filters == 'continent'",
uiOutput("continentCheckbox")
)
)
)
)
)
)
)
server <- function(input, output) {
output$continentCheckbox <- renderUI({
checkboxGroupInput("continentCheckbox ", "Seleziona il Continente:",choices = c("Europa", "Asia", "Africa", "Americhe", "Oceania"))
})
}
shinyApp(ui = ui, server = server)