EDIT: code found on internet for updateTabsetPanel
I want to implement a redirect button in my Shiny application but I have never done this before, neither did I found any information on the internet/forum that can lead me into the right direction.
Basically what I am trying to do is the following: I've got a 'Load data' tab and a 'View data' tab, on the 'Load data' tab the user can select data to upload and upload this by pressing on the button "Upload". When this button is clicked, I want the application to redirect the user to the 'View data' tab, where the contents of the data and some other information gets shown.
Here is my UI.R code where the actionButton is located (the call argument):
wellPanel(
actionButton(inputId = "load_file", label = "Upload", icon = con("cloud-upload"))
)
Here is my UI.R code where the tabs are located:
tabSubMenuViewData <-
tabItem("subMenuViewData",
conditionalPanel(
condition = ("input.load_file > 0"),
tabsetPanel(type = "tab", id = "tabView",
tabPanel("View",DT::dataTableOutput("contents_view")),
tabPanel("Summary", verbatimTextOutput('XSummary')),
tabPanel("Structure", verbatimTextOutput('XStructure')),
tabPanel("Describe", verbatimTextOutput("XDescribe")),
tabPanel("Pivot",rpivotTableOutput("pivot_2"))
)
)
)
On my server.R code I am thinking in this direction:
observe({
if (input$load_file > 0)
updateTabsetPanel(session, "tabView ",selected = "View")
})
Any advice in the right direction is welcome.
Kind regards