Experimental.
Sends only the supplied state facets. reset = TRUE calls the client
instance's reset method. Answer and error lists must be named so module
instances and question definitions remain stable.
Usage
update_shad_questionnaire(
id,
active = NULL,
answers = NULL,
errors = NULL,
reset = FALSE,
session = shiny::getDefaultReactiveDomain()
)See also
Other shadshiny questionnaire:
shad_question(),
shad_questionnaire()
Examples
if (interactive()) {
ui <- page_shad(
shad_questionnaire(
"survey",
shad_question("plan", "Choose a plan",
choices = c(Free = "free", Pro = "pro")),
shad_question("notes", "Anything else?", type = "text",
required = FALSE)
),
shad_button("Start over", inputId = "restart")
)
server <- function(input, output, session) {
shiny::observeEvent(input$restart, {
update_shad_questionnaire("survey", reset = TRUE)
})
}
shiny::shinyApp(ui, server)
}