You have the option to achieve this by rendering text.
UI:
shinyUI(
fluidPage(
# Setting the title of the application
titlePanel("Test"),
sidebarLayout(
sidebarPanel(
actionButton("ShowCond", "Show Conditional Panel"),
conditionalPanel(
condition = "output.test=='5'",
actionButton("CheckFile", "Check file")
)
),
mainPanel(
verbatimTextOutput("test")
)
)
)
)
Server:
shinyServer(function(input, output, session) {
var <- eventReactive(input$ShowCond, {
5
})
output$test <- renderText({
var()
})
})
The important point to note is that without including the verbatimTextOutput, it will not function as expected. It must be incorporated somewhere within your UI section. Nevertheless, you can repurpose it as a message.
EDIT:
It is also achievable without using verbatimtext. By default, Shiny halts all outputs when they are not visible. However, this behavior can be altered by specifying the following option for a particular output variable:
outputOptions(output, "test", suspendWhenHidden=FALSE)
In such cases, there is no necessity for utilizing verbatimtext (and the related rendertext).
Source: