【发布时间】:2020-05-11 14:41:22
【问题描述】:
我的界面中需要多个选项卡,并且我想在每个选项卡中使用条件面板。正如您将在下面的可重现代码中看到的那样,conditionalPanel 在第一个选项卡中有效,但在其他选项卡中无效。
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))
我知道有很多关于条件面板的问题,但我还没有找到这个问题的答案。
提前谢谢你,任何建议都非常感谢
【问题讨论】: