I would need several tabs in my interface, and in each of them I would like to use a conditionalPanel. As you will see here with reproducible code, the conditional panel works on the first tab, but not on other tabs.
ui <- pageWithSidebar(
headerPanel("Hello !"),
sidebarPanel(
tabsetPanel(
tabPanel("a",
textInput(inputId = "A1", label = "1:", value = "A1"),
checkboxInput(inputId = "new_A2",
label = "Add another one",
value = FALSE),
conditionalPanel(
condition = "input.new_A2 == true",
textInput(inputId = "A2", label = "2:", value = "A2")
)),
tabPanel("b",
textInput(inputId = "B1", label = "1:", value = "C1"),
checkboxInput(inputId = "new_B2",
label = "Add another one",
value = FALSE),
conditionalPanel(
condition = "input.new_B2 == true",
textInput(inputId = "B2", label = "2:", value = "C2")
)
)
)
),
mainPanel()
)
server <- function(input,output){
}
runApp(list(ui=ui,server=server))
I know that there are many questions related to conditionalPanel, but I have not yet found the answer to this question.
Thanks in advance, any suggestion highly appreciated
source
share