Bookmarking a navbarPage

I'm trying to bookmark a page in a navbarPage ... here's my little example.

library(shiny)

ui <- fluidPage(
    titlePanel("Bookmarking problem"),
    bookmarkButton(),
    navbarPage("Title",id="bar",
        tabPanel("M1",
             textOutput("t1")
        ),
        tabPanel("M2",
             textOutput("t2")
        )
    )
)

# Define server logic required to draw a histogram
server <- function(input, output, session) {
    output$t1=renderText("ONE")
    output$t2=renderText("TWO")
}

# Run the application 
shinyApp(ui = ui, server = server,enableBookmarking="url")

Pressing the "Bookmark" button produces a url which looks right, but doesn't work. E.g.,
I click on M2 and then press Bookmark and I get a url ...

http://127.0.0.1:4425/?_inputs_&bar=%22M2%22

Put that url in my browser and the app shows up but doesn't go to M2.

What am I missing?

Many thanks,
Geoff

I have solved my problem ... the solution was to re-read the relevant bit in Mastering Shiny :slight_smile:

ui  <- function(request) { ... }
and add "ui" to the beginning of the server function call ...

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.