I just discovered this nice package and tried to reproduce the examples provided here.
I think there is a problem with this one since the second guide (for the second tab) does not run when the first guide is over. I guess one problem is that you used updateTabsetPanel instead of updateNavbarPage but even with this, it doesn't work. I put the code here only for convenience:
library(shiny)
library(cicerone)
home_guide <- Cicerone$
new(id = "homeGuide")$
step(
"home_primary",
"Hello",
"Hello from tab 1"
)$
step(
"home_secondary",
"Text",
"This is an input"
)
tab_guide <- Cicerone$
new()$
step(
"tab_primary",
"Hello",
"Hello from tab 2"
)$
step(
"tab_secondary",
"Text",
"This is an input"
)
ui <- navbarPage(
"cicerone",
header = list(use_cicerone()),
id = "nav",
tabPanel(
"home",
h1("First tab", id = "home_primary"),
textInput("home_secondary", "Text")
),
tabPanel(
"tab",
h1("First tab", id = "tab_primary"),
textInput("tab_secondary", "Text")
)
)
server <- function(input, output, session){
home_guide$init()$start()
observeEvent(input$homeGuide_has_next_step, {
next_step <- input$homeGuide_has_next_step
if(is.null(next_step)) next_step <- TRUE
if(!next_step){
updateTabsetPanel(session, "nav", "tab")
tab_guide$init()$start()
}
})
}
shinyApp(ui, server)
Besides, I'm wondering why the workflow for navbarpage and fluidpage are not identical:
when you have fluidPage with tabsetPanel, you can have a unique guide that contains the ids of the different tabPanels
when you have a navbarPage, you must create one guide per tabPanel and use update* functions in the server part.
Why not making the same system for navbarPage by using the id of the navbar instead of the id of tabsetPanel?
I just discovered this nice package and tried to reproduce the examples provided here.
I think there is a problem with this one since the second guide (for the second tab) does not run when the first guide is over. I guess one problem is that you used
updateTabsetPanel
instead ofupdateNavbarPage
but even with this, it doesn't work. I put the code here only for convenience:Besides, I'm wondering why the workflow for navbarpage and fluidpage are not identical:
fluidPage
withtabsetPanel
, you can have a uniqueguide
that contains the ids of the differenttabPanel
snavbarPage
, you must create one guide pertabPanel
and useupdate*
functions in theserver
part.Why not making the same system for
navbarPage
by using the id of the navbar instead of the id oftabsetPanel
?