I have an R Shiny where server.R
outputs a large number of dynamically generated UI objects.
Rather than process hundreds of objects in input
I'd suggest setting a dummy input that will hold the current value (or in this case, text) of the selected tab.
This might help you:
library(shiny)
library(bsplus)
shinyApp(
ui = fluidPage(
tags$script("$(function() {
$('#meet_the_beatles a').on('click', function(x) {
Shiny.onInputChange('selected_tab', x.target.innerText)
});
});"),
fluidRow(
column(
width = 6,
offset = 3,
bs_accordion(id = "meet_the_beatles") %>%
bs_append(title = "John", content = "Rhythm guitar, vocals") %>%
bs_append(title = "Paul", content = "Bass guitar, vocals") %>%
bs_append(title = "George", content = "Lead guitar, vocals") %>%
bs_append(title = "Ringo", content = "Drums, vocals")
)
),
HTML("