When one enters the words: "alpha," "beta," and "gamma," and the slider is in "5", a window created by 'askpass' should pop up asking for a password (which is "pwd") and open the tab "Two." This process works in my local machine but not in shinyapps.io.
Any idea?
Thanks
library(shiny)
library(shinyjs)
library(askpass)
ui = fluidPage(
useShinyjs(),
sidebarLayout(
sidebarPanel(
selectInput(inputId = "words", label = "Word(s)",
choices = c("alpha","beta","gamma"),
selected = "alpha",
multiple = TRUE),
sliderInput("sldr","Enter number",min=1,max=5,value=3),
),
mainPanel(
navbarPage(title = "",
id = "tsp",
tabPanel("One"),
tabPanel("Two"),
tabPanel("Three"))
) # closes mainPanel
), # closes sidebarLayout
) # closes ui
server = function(input, output) {
observeEvent(c(input$words,input$sldr), {
if(length(input$words)==3){
if(("alpha" == input$words[1]) &&
("beta" == input$words[2]) &&
("gamma" == input$words[3]) &&
(input$sldr == 5)){
if(askpass("Just do it")=="pwd"){showTab(inputId = "tsp", target = "Two")}
}else{
hideTab(inputId = "tsp", target = "Two")
} # closes if ... long set of conditions
}else{
hideTab(inputId = "tsp", target = "Two")
}
})
} # closes server
shinyApp(ui, server)