ReactiveTextInputUI: ReactiveTextInputUI

Description Usage Arguments Value See Also Examples

View source: R/ReactiveTextInput.R

Description

This is a reactive series of text input fields with a functionality for validating the provided text inputs. The number of text input fields in reactive.

Usage

1

Arguments

id

chr id of this object for shiny session

title

chr or NULL for h3 title above text input fields

Value

chr HTML for creating ui elements.

See Also

Other ReactiveTextInput module functions: ReactiveTextInput

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
library(shinyTools)

# some function as example
check <- function(text, add){ if(any(grepl(add$pat, text))) return(paste("Don't use letter", add$pat, "in any entry."))}

# little app with module
ui <- fluidPage(sidebarLayout(
  sidebarPanel(h2("ReactiveTextInputUI"),
               numericInput("nGroups", "n Groups", 2, -2, 10),
               ReactiveTextInputUI("id1", "Groups")
  ),
  mainPanel(h2("Output of ReactiveTextInput"), verbatimTextOutput("display"))
))


server <-function(input, output, session) {
  display <- callModule(ReactiveTextInput, "id1", n = reactive(input$nGroups), prefix = "Group",
                        values = c("Untreated", "Treated"), checkFun = "check", addArgs = list(pat = "X"))
  output$display <- renderPrint(display())
}

shinyApp(ui, server)

mRcSchwering/shinyTools documentation built on May 21, 2017, 4:43 p.m.