r - Input ID not initialized when defined within conditionalPanel -
in sidebar of shiny app, looking offer filtering values of variable when checkbox activating filter has been checked before. trying implement follows:
checkboxinput("filterbydistrict", "activate filtering district", false), conditionalpanel( condition = "input.filterbydistrict == true", checkboxgroupinput( "districts", label = "choose district:", choices = choiceslist, selected = choiceslist ) )
what found districts
input variable never gets initiated. using on server side, check existence fails:
... if(exists(input$districts)) { ...
what missing/doing wrong?
your input defined, exists
doesn't work list elements, try :
"districts" %in% names(input) # or !is.null(input$districts)
Comments
Post a Comment