I have a button (input$savemodel_button), which when pressed, will write a text to SaveModel_text, as below:
savemodeltext <- eventReactive(input$savemodel_button, {
blah blah...
filename <- as.character(L5[2])
savemodeltext <- paste0('Model saved to pickle file ',filename)
})
output$SaveModel_text <- renderText({
savemodeltext <- savemodeltext()
})
Which the above serves the purpose I want. However, I need to implement anothet feature to clear that text when there is a change of input (input$change)
observeEvent(input$change, {
## need to clear SaveModel_text to blank where there is a change of input.
})
Does observeEvent serves my purpose here? if yes, what is the needed code inside to clear the text?
Or should I use updateTextInput as below?
https://shiny.rstudio.com/reference/shiny/1.0.1/updateTextInput.html