I want to hide all elements from a shiny app page on it's load if some condition in the server.R
is not TRUE
. I tried doing it like this:
server.R
output$a <- reactive({
if (condition) {
TRUE
} else {
FALSE
}
})
outputOptions(output, 'a', suspendWhenHidden=FALSE)
and then cover everything in ui.R
with conditionalPanel("output.a == true", ...)
. It works, but my problem is that it still loads all the elements that are inside of that conditionalPanel
, even if it's in FALSE
state. So in <div data-display-if="output.a == true">
there are all the elements i wanted to 'hide' from the user.
Now the question: is it possible to do that kind of conditional behaviour on server-side of an app, and load whole UI if it succeeds? So before I send TRUE
in some reactive to the UI, it loads nothing, or some dummy UI that would tell user something is wrong.