Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/r/80.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
R 在Shiny中,如何连接登录页?_R_Shiny_Shinydashboard - Fatal编程技术网

R 在Shiny中,如何连接登录页?

R 在Shiny中,如何连接登录页?,r,shiny,shinydashboard,R,Shiny,Shinydashboard,我正在创建具有多个登录页的闪亮应用程序,其中一些需要连接。 这里的示例显示,在主页中,选择输入“home”,在仪表板主体中有两个小部件,第一个是“clients”,带有操作按钮“click here”。如果我从SelectInput中选择了“Clients”,我需要此按钮引导到同一登录页 或者我应该创建一个链接以方便跳转到任何页面 这是一个GIF显示我在找什么 UI 图书馆(闪亮) 图书馆(shinydashboardPlus) 图书馆(DT) 图书馆(readxl) 图书馆(dplyr) 库(

我正在创建具有多个登录页的闪亮应用程序,其中一些需要连接。 这里的示例显示,在主页中,选择输入“home”,在仪表板主体中有两个小部件,第一个是“clients”,带有操作按钮“click here”。如果我从SelectInput中选择了“Clients”,我需要此按钮引导到同一登录页 或者我应该创建一个链接以方便跳转到任何页面 这是一个GIF显示我在找什么

UI
图书馆(闪亮)
图书馆(shinydashboardPlus)
图书馆(DT)
图书馆(readxl)
图书馆(dplyr)
库(格式化表)
图书馆(shinydashboard)
图书馆(shinyjqui)
图书馆(shinyjs)
图书馆(shinythemes)
图书馆(降价)

title试试ObserveeEvent或conditional panel,老实说,我不知道怎么做,但我猜它会起作用

Groupbutton<- fluidPage(widgetUserBox(title = "Group",shiny::actionButton(inputId='ab1', label="Click here"),type = 2, 
            src = "https://adminlte.io/themes/AdminLTE/dist/img/user7-128x128.jpg",color = "blue"))
Clientsbutton<-fluidPage(widgetUserBox(title = "Global",shiny::actionButton(inputId='ab1', label="Click here"),type = 2, 
            src = "https://adminlte.io/themes/AdminLTE/dist/img/user7-128x128.jpg", color = "red"))
shinyServer(function(input, output, session){output$ui_myHome<-renderUI({
if (input$listofitems == 'Home'){(fluidPage(
    widgetUserBox(title = "Clients",
      shiny::actionButton(inputId='clientsmainbuttonId', label="Click here"),
      type = 2, src = "https://adminlte.io/themes/AdminLTE/dist/img/user7-128x128.jpg", color = "yellow"),
    widgetUserBox(title = "Group",
      shiny::actionButton(inputId='GroupbuttonId', label="Click here"),
      type = 2, src = "https://adminlte.io/themes/AdminLTE/dist/img/user7-128x128.jpg", color = "green")))}

else if (input$listofitems == 'Clients'){(Clientsbutton)}
else if (input$listofitems == 'Group'){(Groupbutton)} })  observeEvent(input$GroupbuttonId,{updateSelectInput(session,"listofitems","Items List", choices =c("Home","Group","Clients"), selected ="Group")},ignoreInit = TRUE)
observeEvent(input$clientsmainbuttonId,{updateSelectInput(session,"listofitems","Items List", choices =c("Home","Group","Clients"), selected = "Clients")},ignoreInit = TRUE)})

groupbutton我将同时尝试这两种方法
Groupbutton<- fluidPage(widgetUserBox(title = "Group",shiny::actionButton(inputId='ab1', label="Click here"),type = 2, 
            src = "https://adminlte.io/themes/AdminLTE/dist/img/user7-128x128.jpg",color = "blue"))
Clientsbutton<-fluidPage(widgetUserBox(title = "Global",shiny::actionButton(inputId='ab1', label="Click here"),type = 2, 
            src = "https://adminlte.io/themes/AdminLTE/dist/img/user7-128x128.jpg", color = "red"))
shinyServer(function(input, output, session){output$ui_myHome<-renderUI({
if (input$listofitems == 'Home'){(fluidPage(
    widgetUserBox(title = "Clients",
      shiny::actionButton(inputId='clientsmainbuttonId', label="Click here"),
      type = 2, src = "https://adminlte.io/themes/AdminLTE/dist/img/user7-128x128.jpg", color = "yellow"),
    widgetUserBox(title = "Group",
      shiny::actionButton(inputId='GroupbuttonId', label="Click here"),
      type = 2, src = "https://adminlte.io/themes/AdminLTE/dist/img/user7-128x128.jpg", color = "green")))}

else if (input$listofitems == 'Clients'){(Clientsbutton)}
else if (input$listofitems == 'Group'){(Groupbutton)} })  observeEvent(input$GroupbuttonId,{updateSelectInput(session,"listofitems","Items List", choices =c("Home","Group","Clients"), selected ="Group")},ignoreInit = TRUE)
observeEvent(input$clientsmainbuttonId,{updateSelectInput(session,"listofitems","Items List", choices =c("Home","Group","Clients"), selected = "Clients")},ignoreInit = TRUE)})