Commit 30c3872f authored by jlopez's avatar jlopez
Browse files

Change to conditionalPanel

parent 5d124132
......@@ -6,12 +6,14 @@ tabsetPanel(type = "tabs",
tabPanel("Biblio", height = "300px", style = "overflow: hidden; overflow-y:scroll", br(),
selectInput("selectinformations_user", label = "Select the tool to use : ", choices = list("D" = "D")),
conditionalPanel(
condition = "input.selectinformations_user == 'D'",
box(title = "Tool D :", width = 12, status = "success", collapsible = TRUE, solidHeader = TRUE,
textInput("first_name", label = "First name :", value = "", width = "auto"),
textInput("last_name", label = "Last name :", value = "", width = "auto")
)
))
)
......
......@@ -6,6 +6,8 @@ tabsetPanel(type = "tabs",
tabPanel("Param panel 1", height = "300px", style = "overflow: hidden; overflow-y:scroll", br(),
selectInput("selectpanel1", label = "Select the tool to use : ", choices = list("A" = "A", "B" = "B")),
conditionalPanel(
condition = "input.selectpanel1 == 'A'",
box(title = "Tool A :", width = 12, status = "success", collapsible = TRUE, solidHeader = TRUE,
textInput("param1", label = "Input Param1 :", value = "", width = "auto"),
......@@ -19,8 +21,10 @@ tabPanel("Param panel 1", height = "300px", style = "overflow: hidden; overflow-
actionButton("testButton", "Test", class="btn btn-success")
),
)),
conditionalPanel(
condition = "input.selectpanel1 == 'B'",
box(title = "Tool B :", width = 12, status = "success", collapsible = TRUE, solidHeader = TRUE,
selectInput("param4", label = "Selected param4 :", choices = list("A" = "A", "B" = "B", "C" = "C"), selected = "B", width = "auto"),
......@@ -30,12 +34,14 @@ tabPanel("Param panel 1", height = "300px", style = "overflow: hidden; overflow-
p("Just simple text for description or help")
)
))
),
tabPanel("Param panel 2", height = "300px", style = "overflow: hidden; overflow-y:scroll", br(),
selectInput("selectpanel2", label = "Select the tool to use : ", choices = list("C" = "C")),
conditionalPanel(
condition = "input.selectpanel2 == 'C'",
box(title = "Tool C :", width = 12, status = "success", collapsible = TRUE, solidHeader = TRUE,
textInput("param10", label = "Input Param 10 :", value = "", width = "auto"),
......@@ -43,12 +49,14 @@ tabPanel("Param panel 2", height = "300px", style = "overflow: hidden; overflow-
fileInput("param7", label = "Chose file :", accept = c(".csv", ".xslx"), multiple = FALSE, width = "auto")
)
))
),
tabPanel("Param panel 3", height = "300px", style = "overflow: hidden; overflow-y:scroll", br(),
selectInput("selectpanel3", label = "Select the tool to use : ", choices = list("biotoolB" = "biotoolB", "biotoolA" = "biotoolA")),
conditionalPanel(
condition = "input.selectpanel3 == 'biotoolB'",
box(title = "Tool biotoolB :", width = 12, status = "success", collapsible = TRUE, solidHeader = TRUE,
textInput("inputs_param1", label = "Input Param1 :", value = "", width = "auto"),
......@@ -62,22 +70,20 @@ tabPanel("Param panel 3", height = "300px", style = "overflow: hidden; overflow-
actionButton("inputs_testButton", "Test", class="btn btn-success")
),
)),
conditionalPanel(
condition = "input.selectpanel3 == 'biotoolA'",
box(title = "Tool biotoolA :", width = 12, status = "success", collapsible = TRUE, solidHeader = TRUE,
textInput("param1", label = "Input Param1 :", value = "", width = "auto"),
sliderInput("param2", label = "Slider param2 :", min = 0, max = 100, step = 1, width = "auto", value = 50),
sliderInput("param3", label = "Slider param3 :", min = 10, max = 20, step = 0.1, width = "auto", value = c(11.8,19.6)),
textInput("inputs_param1", label = "Input Param1 :", value = "", width = "auto"),
checkboxInput("param8", label = "Checkbox 1", value = TRUE),
checkboxInput("inputs_param8", label = "Checkbox 1", value = TRUE),
checkboxInput("param9", label = "Checkbox 2", value = FALSE),
checkboxInput("inputs_param9", label = "Checkbox 2", value = FALSE),
actionButton("testButton", "Test", class="btn btn-success")
actionButton("inputs_testButton", "Test", class="btn btn-success")
)
))
),
......
......@@ -13,8 +13,8 @@ observeEvent(input$inputs_testButton, {
})
#' Event when use testButton button
observeEvent(input$testButton, {
#' Event when use inputs_testButton button
observeEvent(input$inputs_testButton, {
})
......@@ -129,29 +129,22 @@ observeEvent(input$runP, {
# Tool : biotoolA
if(input$selectpanel3 == "biotoolA") {
if(!is.na(as.numeric(input$param1))) {
res <- paste(res, "param1:", input$param1, "\n", sep = " ")
if(!is.na(as.numeric(input$inputs_param1))) {
res <- paste(res, "inputs_param1:", input$inputs_param1, "\n", sep = " ")
} else {
res <- paste(res, "param1:", paste0('"', input$param1, '"'), "\n", sep = " ")
res <- paste(res, "inputs_param1:", paste0('"', input$inputs_param1, '"'), "\n", sep = " ")
}
res <- paste(res, "param2:", input$param2, "\n", sep = " ")
res <- paste(res, "param3_min:", input$param3[1], "\n", sep = " ")
res <- paste(res, "param3_max:", input$param3[2], "\n", sep = " ")
res <- paste(res, "param3_step:", "0.1", "\n", sep = " ")
if(input$param8) {
res <- paste(res, "param8:", "true", "\n", sep = " ")
if(input$inputs_param8) {
res <- paste(res, "inputs_param8:", "true", "\n", sep = " ")
} else {
res <- paste(res, "param8:", "false", "\n", sep = " ")
res <- paste(res, "inputs_param8:", "false", "\n", sep = " ")
}
if(input$param9) {
res <- paste(res, "param9:", "true", "\n", sep = " ")
if(input$inputs_param9) {
res <- paste(res, "inputs_param9:", "true", "\n", sep = " ")
} else {
res <- paste(res, "param9:", "false", "\n", sep = " ")
res <- paste(res, "inputs_param9:", "false", "\n", sep = " ")
}
}
......
......@@ -268,6 +268,10 @@ generate_pages_server <- function() {
}
}
res <- res + '\tconditionalPanel(\n'
res <- res + '\tcondition = "input.select' + panel$name + ' == \'' + box$name + '\'",\n'
res <- res + '\tbox(title = "' + box$title + '", width = 12, status = "' + box$status + '", collapsible = TRUE, solidHeader = TRUE'
panel_content = box$content
......@@ -293,9 +297,9 @@ generate_pages_server <- function() {
}
if(b < length(panel_boxes)) {
res <- res + '\t),\n\n'
res <- res + '\t)),\n\n'
} else {
res <- res + '\t)\n\n'
res <- res + '\t))\n\n'
}
}
......
......@@ -4,8 +4,6 @@ title: "Tool biotoolA :",
status: "success",
content: [
{name: "param1", type: "text", value: "", label: "Input Param1 :"},
{name: "param2", type: "slider", min: 0, max: 100, step: 1, value: [50], label: "Slider param2 :"},
{name: "param3", type: "slider", min: 10, max: 20, step: 0.1, value: [11.8, 19.6], label: "Slider param3 :"},
{name: "param8", type: "checkbox", value: TRUE, label: "Checkbox 1"},
{name: "param9", type: "checkbox", value: FALSE, label: "Checkbox 2"},
{name: "testButton", type: "button", icon: "", class: "btn btn-success", label: "Test"},
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment