下面是我模块的服务器功能。它显示一个selectInputGUI,其中显示文件列表。用户必须选择多个。如果用户仅选择1,则显示条件面板的selectInput gui。此功能有效,但仅适用一次。换句话说,如果用户仅通过第一个selectInput选择1个文件,则显示条件面板,但是如果用户再次选择1个文件,则条件面板不会再次执行。如何使条件面板迭代,以便如果用户再次选择一个文件,条件面板将再次执行。我希望条件面板在用户输入多个文件之前执行。谢谢。
firstServer <- function(input, output, session, a) {
ns = session$ns
output$first <- renderUI({
tagList(
# selectInput(ns("select"), h4("Select"), paste0(isolate(a()), letters[1:4]))
selectInput(ns("select"), h5(strong("PLEASE CHOSE FILES TO COMBINE. To undo selection select the selected file again and press delete")),c(Choose='', list.files("~/Folder1/folder2/folder3/DATA")), multiple=TRUE, selectize=TRUE),
conditionalPanel(sprintf("input['%s'].length == '1'", ns("select")),
selectInput("select",label = h5(strong("Must select more than one data set. Try again.. To undo selection select the selected file again and press delete")),c(Choose='', list.files("~/Foldere1/folder2/folder3/DATA")), multiple=TRUE, selectize=TRUE)
)
)
})
returnedValue <- (reactive({ paste0(input$select) }))
#return(reactive({ paste0(input$select) }))
return(returnedValue)
}