Mario M. Mario M. - 21 days ago 7
Javascript Question

R Shiny: conditionalPanel not working if used several widgets

Conditional pannel doesn't show the message "Loading..." in my shiny app. Message must appear when all widgets have been pressed.

sidebarPanel(id="sidebar",
textInput("id1", "Write word 1:"),
textInput("id2", "Write word 2:"),
selectInput("line", "Select:",
c("Line1"=1,
"Line2"=2,
"Line3"=3)),
dateRangeInput("dateRange",
label = "Select a date range:", start = as.character(Sys.Date()-1), end = as.character(Sys.Date()),
actionButton("update", "OK"),
p("Press OK to update inputs"),
conditionalPanel(condition="input.id1>0 && input.id2>0 && input.line>0 && input.dateRange>0 && input.update>0",
tags$div("Loading...",id="loadmessage"))
)


I think the condition is wrong.

Answer

Problem with compare numeric and character in js

You need to use 0 only for numerict results ( actionButton and selectInput in your example)

You need such condition input.id1>'' && input.id2>'' && input.line>0&& input.dateRange>'' && input.update>0