Reputation: 1450
For layout reasons, I try to send a single number (number of plots for example) form server to ui. Moreover, I'd like to use this number then to define the width of a box.
Is this possible? And if, how? Thank you very much for your help.
Upvotes: 1
Views: 179
Reputation: 1327
I think if I understand correct, you would want to achieve the following:
You could do something like this in the server:
shinyServer(func = function(input, output, session) {
field1_options <- reactive({
if (!is.null(input$field1)) {
method1(input$field1)
} else {
method2(input$field1)
}
})
observe({
updateSelectInput(
session,
inputId = "field2",
choices=field1_options())
})
}
What this does is simply use the value from field1 to calculate and populate field2, here i've used example of Select Input.
Upvotes: 1