title: Update Checkbox Group Input Not Working for More than One Checkbox
body: <p>Why does this <code>updateCheckboxGroupInput()</code> code not work when more than 1 checkboxes are selected. When one checkbox from the above group is selected, the box below should update to show more specific entries. But if more than one checkbox is selected at the top, the code fails. Anyone knows what the issues might be?</p>
  
  <p>Copy from here or bitbucket: <a href="https://bitbucket.org/snippets/afolabicrystal/deyay5" rel="nofollow noreferrer">https://bitbucket.org/snippets/afolabicrystal/deyay5</a></p>
  
  <pre><code>  ui &lt;- fluidPage(
  p("The first checkbox group controls the second"),
  checkboxGroupInput("inCheckboxGroup", "Device Class",
                     c("TV", "Mobile", "Tablet")),
  checkboxGroupInput("inCheckboxGroup2", "Device Types",
                     c("Amazon TV", "Apple TV", "Android Phone", "iPhone", "iPad", "Android Tablet")))
  
  
    server &lt;- function(input, output, session) {
  observe({
    x &lt;- input$inCheckboxGroup
  
  
    # Can also set the label and select items
    updateCheckboxGroupInput(session, "inCheckboxGroup2",
                             label = paste("Device Types", length(x)),
                             if ('TV' %in% x) {
                               choices = c("Amazon TV", "Apple TV")
                             } else if("Mobile" %in% x) {
                               choices = c("Android Phone", "iPhone")
                             } else if("Tablet" %in% x) {
                               choices = c("iPad", "Android Tablet")
                             } else if (all(c("TV","Mobile") %in% x)) {
                               choices = c("Amazon TV", "Apple TV", "Android Phone", "iPhone")
                             } else if (all(c("TV","Tablet") %in% x)) {
                               choices = c("Amazon TV", "Apple TV", "iPad", "Android Tablet")
                             } else if (all(c("Mobile","Tablet") %in% x)) {
                               choices = c("Android Phone", "iPhone", "iPad", "Android Tablet")
                             } else if (all(c("TV", "Mobile", "Tablet") %in% x)) {
                               choices = c("Amazon TV", "Apple TV", "Android Phone", "iPhone", "iPad", "Android Tablet")
                             } else {
                               choices = character(0)
                             },
                             selected = choices
    )
  })
  }
  shinyApp(ui, server)
  </code></pre>