-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdynamic_ex.R
35 lines (30 loc) · 957 Bytes
/
dynamic_ex.R
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
library(shiny)
ui <- fluidPage(
#includeScript('www/enter_bind.js'),
singleton(tags$head(tags$script(src = "enter_bind.js"))),
tags$input(type='command', id='command1', class='reactnb-command',
autocomplete='off', autocorrect='off'
),
tags$br(),
# tags$input(type='command', id='command2', class='reactnb-command',
# autocomplete='off', autocorrect='off'
# ),
verbatimTextOutput("o1"),
verbatimTextOutput("o2"),
verbatimTextOutput("o3")
)
server <- function(input, output) {
output$o1 <- renderPrint({
input$command1
})
output$o2 <- renderPrint({
input$command2
})
output$o3 <- renderPrint({
print(reactiveValuesToList(input))
})
}
runApp(shinyApp(ui, server), launch.browser = TRUE)
# it looks like `input$...` works on element id. However,
# in the example app, the input is of type `shiny-bound-input`.
# I believe this happens with a call to `Shiny.inputBindings.register(...)`