From 37ccdfd3a7e213594f1455d6f2c3c5aab111cd81 Mon Sep 17 00:00:00 2001 From: Bernhard Date: Wed, 18 Aug 2021 17:57:16 +0200 Subject: [PATCH 1/3] Adding missing session parameter to code example I assume outside of the server context, the method needs to have an explicit session parameter and the caller also needs to pass it in. --- scaling-functions.Rmd | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) 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)) } ``` From 754d13ee1eff661492be42815789850bff987684 Mon Sep 17 00:00:00 2001 From: Bernhard Date: Thu, 19 Aug 2021 09:59:35 +0200 Subject: [PATCH 2/3] Fixing typo and adjust wording --- scaling-modules.Rmd | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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( From 157d3db2353857b91addef345bc6e919e7497b42 Mon Sep 17 00:00:00 2001 From: Bernhard Date: Thu, 19 Aug 2021 11:44:32 +0200 Subject: [PATCH 3/3] Removing duplicate word --- scaling-testing.Rmd | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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: