Shiny UI: Save the Changes in the Inputs

后端 未结 3 1560
一整个雨季
一整个雨季 2020-12-30 18:07

I have quite a problem. I\'m trying to run a program with quite a few different settings, which can be set in the ui. In my case the user may need to run the programm with t

3条回答
  •  慢半拍i
    慢半拍i (楼主)
    2020-12-30 18:35

    Sorry, it took me a while. Thanks for all the answers.

    I kinda found a workaround (I'll be posting only the relevant parts of my code). I found the solution using conditionalpanel. In my app the user has to define the settings before he starts the calculations and it was crucial that he saves them first (various reasons, mainly reproducibility). So I created a tabpanel for each step in the calculation and my quite simple solution was that every tabpanel relies on the save button. The result is that the user can't even start the calculation before he hasn't saved the settings.

    shinyUI(navbarPage(title=div(img(src="---", height=72, width=72, align="left")), theme ="bootstrap.css", fluid=T,
    
    
    
    
                     tabPanel("Startseite",
    tags$head(tags$script(HTML('
          Shiny.addCustomMessageHandler("jsCode",
            function(message) {
              console.log(message)
              eval(message.code);
            }
          );
        '))),
    
                            actionButton("Ja",
                                         label="Neue Berechnung beginnen",
                                         icon("upload",lib="font-awesome")),
    
                            actionButton("Nein",
                                         label="Bestehende Berechnung laden",
                                         icon("upload",lib="font-awesome"))),
    
                   tabPanel("Einstellungen", progressInit(),
    
                            conditionalPanel(condition="input.Ja > 0",
    
                                             wellPanel(actionButton("save",
                                                                    label="Einstellungen speichern",
                                                                    icon("save",lib="font-awesome")
                                                                    ),
                                                       br(),
                                                       br(),
                                                       navlistPanel("Einstellungen",
    
    
    
    tabPanel("Interne Kalibrierung",
         conditionalPanel(condition="input.save> 0",
    
                          wellPanel(actionButton("freqbutton", "Frequenzschätzung durchführen"),
                                    plotOutput("freqPlot")
                                    ),
    
    
                                          wellPanel(actionButton("intthresbutton", "Berechnung der internen Threshold"),
                                                    dataTableOutput("IntTable")
                                                    ))
    
    
         ),
    

提交回复
热议问题