The actionButton
is a substitute for submitButton
, and it allows more control over which inputs will trigger re-execution of reactive objects. A submitButton
simply stops all inputs on the page from sending their values to the server until the button is clicked.
When there's an actionButton
on the client, the corresponding code on the server should use isolate()
. Code that appears within an isolate()
will not invalidate (and thus trigger the re-execution of) the reactive object.
In the example here, changes to input$n
won't cause the code in renderPlot()
to be re-executed, since it's used within isolate()
. However, changes to input$goButton
will cause the code in renderPlot()
to re-execute. Each time the user clicks on the button, it will increment the numeric value of input$goButton
, which will invalidate the reactive object and schedule it for re-execution.
Thank you. This was quite helpful.