| glassSelectValue | R Documentation |
Convenience helper for extracting a single-select widget's value from Shiny's
input object without using modules.
glassSelectValue(input, inputId)
input |
Shiny |
inputId |
Input id used in |
A reactive expression returning the current selected value as a
character scalar, or NULL when nothing is selected.
Other glass select widgets:
glassMultiSelect(),
glassMultiSelectServer(),
glassMultiSelectValue(),
glassSelect(),
glassSelectServer(),
updateGlassMultiSelect(),
updateGlassSelect()
if (interactive()) {
library(shiny)
ui <- fluidPage(
useGlassTabs(),
glassSelect("fruit", c(Apple = "apple", Banana = "banana"))
)
server <- function(input, output, session) {
fruit <- glassSelectValue(input, "fruit")
observe({
print(fruit())
})
}
shinyApp(ui, server)
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.