我正在尝试创建一个conditionalPanel
,显示填写前一个input
的时间。我希望conditionalPanel
根据初始input
填充选项。
我的代码看起来像这样:
selectInput("initialvalue", "Initial Value", c("Choose one" = "", as.character(initialvaluelist))),
conditionalPanel(
condition = "input.initialvalue=='First Option'",
selectInput("conditionalchoices", "Conditional Choices", choices = c("Click to select from list" = "", firstoptionchoices), selected = NULL, multiple=TRUE)),
conditionalPanel(
condition = "input.initialvalue=='Second Option'",
selectInput("conditionalchoices", "Conditional Choices", choices = c("Click to select from list" = "", secondoptionchoices), selected = NULL, multiple=TRUE))
在此示例中,选择First Option
会提升firstoptionchoices
,选择Second Option
会提升secondoptionchoices
。
这适用于UI,但只有第一个conditionalPanel
条件才会更新反应变量。第二个没有。我错过了什么?