Open tomicapretto opened 3 years ago
I want to have a button inside a tabPanel within a tabBox that when clicked switches to another tabPanel within the same tabBox.
tabPanel
tabBox
None of the approaches I tried worked. Also, I couldn't find much documentation on how this is expected to work.
I'm using shiny 1.5.0 and shinydashboard 0.7.1
shiny
shinydashboard
Concisely, is this the correct approach? Is it possible to do what I am trying to do? Thank you!
library(shiny) library(shinydashboard) ui <- dashboardPage( dashboardHeader(), dashboardSidebar(), dashboardBody( fluidRow( tabBox( id = "tabs", height = "auto", width = 12, title = "", tabPanel( title = "Title1", value = "one", actionButton("move", "Move!") ), tabPanel( title = "Title2", value = "two", actionButton("moveback", "Move back!") ) ) ) ) ) server <- function(input, output, session) { observeEvent(input$move, { print("move!") updateTabsetPanel(session, "tabs", "one") }) observeEvent(input$moveback, { print("moveback!") updateTabsetPanel(session, "tabs", "two") }) observeEvent(input$tabs, print(input$tabs)) } shinyApp(ui, server)
I want to have a button inside a
tabPanel
within atabBox
that when clicked switches to anothertabPanel
within the sametabBox
.None of the approaches I tried worked. Also, I couldn't find much documentation on how this is expected to work.
I'm using
shiny
1.5.0 andshinydashboard
0.7.1Concisely, is this the correct approach? Is it possible to do what I am trying to do? Thank you!