0
votes

My renderDataTable() does not seem to react to reactive input. 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. 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

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'))
    )  

)
1

1 Answers

2
votes

Taken from the documentation for 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.