With reference to the code below, right now, all the verbatimTextOutput boxes are only updated when results
have been returned for all the columns.
I want the UI to show the output when results
are returned for each column, to indicate that the application is indeed making progress.
How can I do that?
INPUT_COL = c("V1","V2","V3")
shinyUI(fluidPage(
sidebarLayout(
sidebarPanel(
uiOutput("controls")
),
mainPanel(
lapply(INPUT_COL, function(self){
verbatimTextOutput(outputId=paste0("vb.",self))
})
)
)
))
shinyServer(function(input, output,session) {
output$controls<- renderUI({
lapply(INPUT_COL, function(self) {
output[[self]] <- renderUI(...)
uiOutput(self)
})
})
observe({
params <- sapply(INPUT_COL, function(self) input[[self]])
lapply(INPUT_COL, function(self) {
output[[paste0("vb.",self)]] <- renderPrint(
{ tryCatch(
{
results<- getResults(params) #some long process
print(results)
},
warning=function(war) return(war),
error=function(err) return(err)
)
})
})
})
}