I have moved over to the new bs4dash and I am having some issues with updating the control bar. For each different tab on my sidebar i would like a corresponding control bar. For example, if the sidebar tab is "Home", I would like to the controlbar to consist of multiple selectizeInputs. If however, the sidebar tab is "News", I would like the Control Bar to have different textOutputs.
Here is some of the code I am using
##UI
controlbar = dashboardControlbar(
id = "controlbar",
collapsed = T
)
##Server
observeEvent(input$current_tab,{
if(input$current_tab == "home"){
updateControlbar(id = "controlbar", session = session,
selectizeInput("one", "one", choices = c(1,2,3)
),
selectizeIntput("two", "two", choices = c(1,2,3)
} else if(input$current_tab == "News"){
updateControlbar(id = "controlbar", session = session,
textInput("news1"),
textInput("news2")
}
})
I have also tried many other combos but nothing seems to work. Thank you for your help
You can combine conditional panels with reactive functions. This code snippet show a very trivial case.