## This code, placed inside ui.R, creates the collapse group with 3 panels:
bsCollapse(multiple = FALSE, open = "col1", id = "collapse1",
bsCollapsePanel("Collapse #1", "Cell treachery spearwife night\'s
watch, tower suckling ...",
id="col1", value="test1"),
bsCollapsePanel("Collapse #2", actionButton("btn123", "A Button"),
textInput("txt1234", "A Text Input"),
id="col2", value="test2"),
bsCollapsePanel("Collapse #3", plotOutput("testPlot1"),
id="col3", value="test3")
)
## This code, placed inside server.R, will change multiple to TRUE and open
## the first and third panels:
updateCollapse(session, "collapse1", multiple = TRUE,
open = c("col1", "col2"))
Run the code above in your browser using DataLab