rshiny

Using Conditional Panel with PickerInput in R


In the given R shiny script below, I am trying to use a conditional panel with Picker Input shiny widget. There are three options in pickerInput, upon selection of "times" option, I wish to create new pickerInputs using a conditional panel, the following is possible using selectInput, but I need the same for Picker Input.

library(shiny)
library(shinydashboard)
ui <- dashboardPage(
dashboardHeader(title = "Picket",titleWidth = 290),
dashboardSidebar(width = 0),
dashboardBody(
tabsetPanel(type = "tab",
            tabPanel("Overview", value = 1,
                     
                     box(
                       column(1, 
                              dropdown(
                                pickerInput(inputId = "resources", 
                                            label = "", 
                                            choices = c("cases", 
                                                        "activities", 
                                                        "times"), 
                                            choicesOpt = list(icon = c("fa fa-bars", 
                                                                       "fa fa-bars", 
                                                                       "fa fa-safari")), 
                                            options = list(`icon-base` = "")),
                                circle = FALSE, status = "primary", icon = icon("list", lib = "glyphicon"), width = "300px"
                              ),
                              conditionalPanel(
                                condition = "input.Position == 'times' ",
                                dropdown(
                                pickerInput(inputId = "Id072", 
                                            label = "Select/deselect all options", 
                                            choices = c("A","Check-out", "b","c","d","e","f")
                                            )))))),
           
id= "tabselected"

            )

            ))


server <- function(input, output) { 
}
shinyApp(ui, server)

Solution

  • Shouldnt this condition = "input.Position == 'times' ", be condition = "input.resources == 'times' ",?