简体   繁体   English

闪亮的无功输入不起作用

[英]Reactive input in Shiny not working

My renderDataTable() does not seem to react to reactive input. 我的renderDataTable()似乎对反应性输入没有反应。 I am not sure what is missing. 我不确定缺少什么。 Before when I entered into the text input for every 'Enter' key pressed the changed text would be detected. 在我按每个“ Enter”键输入文本输入之前,将检测到更改的文本。 Now I have a explicitly click the submit buttonThe code is as below 现在我有一个明确单击提交按钮的代码如下

server.R 服务器

shinyServer(function(input, output) {

   toggle("inputBox")
   toggle("text")
   dataInput <- reactive({input$text})
   output$table1 <- renderDataTable({(options = list(pageLength = 10,searchable = FALSE))
   a <- function1(dataInput())

  })
  output$table2 <- renderDataTable({
     b <- function2(dataInput()) 

  })


})

u1.R u1

fluidRow(
    column(4,
           code(id = "inputBox", "Please wait, loading ..."),
           hidden(textInput("text", label = h3("Enter words"), 
                     value = "xxxx xxxx")),br(),
           actionButton("action", label = " Please hit Enter or click submit"),
           br(),
           br(), 
           submitButton("Submit")
    )
),
 fluidRow(
      column(4,             
           tabPanel('Header1', dataTableOutput('table1'))
    ),
    column(2
    ),
    column(4,
           tabPanel('Header2', dataTableOutput('table2'))
    )  

)

Taken from the documentation for submitButton() : submitButton()的文档中获取:

Forms that include a submit button do not automatically update their outputs when inputs change, rather they wait until the user explicitly clicks the submit button. 包含提交按钮的表单在输入发生更改时不会自动更新其输出,而是会等到用户明确单击提交按钮。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM