diff --git a/scaling-functions.Rmd b/scaling-functions.Rmd index 1927d43c..9a37b198 100644 --- a/scaling-functions.Rmd +++ b/scaling-functions.Rmd @@ -278,15 +278,15 @@ This doesn't make testing or debugging any easier, but it does reduce duplicated We could of course add `session` to the arguments of the function: ```{r} -switch_page <- function(i) { - updateTabsetPanel(input = "wizard", selected = paste0("page_", i)) +switch_page <- function(i, session) { + updateTabsetPanel(session = session, input = "wizard", selected = paste0("page_", i)) } server <- function(input, output, session) { - observeEvent(input$page_12, switch_page(2)) - observeEvent(input$page_21, switch_page(1)) - observeEvent(input$page_23, switch_page(3)) - observeEvent(input$page_32, switch_page(2)) + observeEvent(input$page_12, switch_page(2, session)) + observeEvent(input$page_21, switch_page(1, session)) + observeEvent(input$page_23, switch_page(3, session)) + observeEvent(input$page_32, switch_page(2, session)) } ``` diff --git a/scaling-modules.Rmd b/scaling-modules.Rmd index 244a4516..edb6e31c 100644 --- a/scaling-modules.Rmd +++ b/scaling-modules.Rmd @@ -983,7 +983,7 @@ This is a principled limitation of the module system which we'll discuss in more Now let's use the wizard in a slightly more realistic app that has inputs and outputs, and yields Figure \@ref(fig:wizard-module). The main point to notice is that even though the pages are displayed by the module, their ids are controlled by the user of the module. -It's the developer who creators the control who controls its name; it doesn't matter who ends up assembling the control for final display on the webpage. +It's the developer who creates the control and controls its name; it doesn't matter who ends up assembling the control for final display on the webpage. ```{r} page1 <- tagList( diff --git a/scaling-testing.Rmd b/scaling-testing.Rmd index 2ada29e0..e167eae3 100644 --- a/scaling-testing.Rmd +++ b/scaling-testing.Rmd @@ -428,7 +428,7 @@ summaryServer <- function(id, var) { ``` We'll use `testServer()` as above, but the call is a little different. -As before the first argument is the server function (now the the module server), but now we also need to supply additional arguments in a list called `args`. +As before the first argument is the server function (now the module server), but now we also need to supply additional arguments in a list called `args`. This takes a list of arguments to the module server (the `id` argument is optional; `testServer()` will fill it in automatically if omitted). Then we finish up with the code to run: