STAT545-UBC / Discussion

Public discussion
38 stars 20 forks source link

HW08: Problem with two conditional panels #533

Open fjbasedow opened 5 years ago

fjbasedow commented 5 years ago

Hi,

I have a conditional panel in my UI for country selection that only shows up if "filter by country" is selected. This one works as expected. Now I am trying to add an additional conditional panel to select subtypes of wine. However, when I add this one, both conditional panels are not working, i.e. they are always there, no matter what is selected. Moreover, the filtering of countries is also not working. If I delete the part for subtypes, the conditional panel for country filtering is working again. If I delete the part for countries, my conditional panel for subtypes is still not working.

Does anyone know why a new conditional panel would affect another one?

Here is my code for the side bar in the UI:

sidebarPanel(
  sliderInput("priceInput", "Price", 0, 100, c(25, 40), pre = "$"),
  uiOutput("typeOutput"),
  conditionalPanel(
    condition = "input.typeInput %in% 'WINE'",
    uiOutput("subtypeOutput")
    ),
  checkboxInput("countryFilter", "Filter by country", value = FALSE),
  conditionalPanel(
    condition = "input.countryFilter",
    uiOutput("countryOutput")
  )
)

Thanks!