I'm trying to update the value shown in textInput based on selectInput. I originally didn't have the if-else statement in output$text, but based on suggestions from other questions, added it, but it still didn't work. I then tried the solution from "Shiny renderUI selectInput NULL", but that didn't work either.
Portion from server.r:
names <- list("A"=1, "B"=2, "C"=3, "D"=4, "E"=5, "F"=6, "G"=7, "H"=8, "I"=9)
# UI
output$view <- renderUI({
selectInput("viewTopic", "View Topic:", choices = names, selected = 1)
})
output$text <- renderUI({
if(is.null(input$viewTopic)){
return()
}else{
textInput("docTitle", label = "Topic Name:", value = names[input$viewTopic])
}
})
Currently, "value" in textInput is just NULL. How can I make the value for textInput update based on the selectInput?