I have 3 sets of radio buttons and I want to update/ reset them under certain conditions:
plotChoices <- c(
"Line Graph" = "line",
"Scatter Plot" = "scatter"
)
So if "line" is not selected all together at these 3 sets, then reset plot2's and plot2's:
observeEvent(input$plot1, {
if (input$plot1 == 'line' &&
(!is.null(input$plot2) && input$plot2 == 'line') &&
(!is.null(input$plot3) && input$plot3 == 'line')
) return ()
updateRadioButtons(
session,
"plot2",
label = "Analyze Plot2 data:",
choices = plotChoices,
selected = character(0),
inline = FALSE
)
updateRadioButtons(
session,
"plot3",
label = "Analyze Plot3 data:",
choices = plotChoices,
selected = character(0),
inline = FALSE
)
session$sendCustomMessage(type = "resetValue", message = "plot2")
})
But it does not work at all. It only reset plot2 but not plot3.
Any ideas? Is it a bug in Shiny?