# NOT RUN {
if (interactive()) {
library(shiny)
library(shinyMobile)
ui <- f7Page(
f7SingleLayout(
navbar = f7Navbar(title = "updateF7Text"),
f7Block(f7Button("trigger", "Click me")),
f7Text(
inputId = "text",
label = "Caption",
value = "Some text",
placeholder = "Your text here"
),
verbatimTextOutput("value")
)
)
server <- function(input, output, session) {
output$value <- renderPrint(input$text)
observeEvent(input$trigger, {
updateF7Text("text", value = "Updated Text")
})
}
shinyApp(ui, server)
}
if (interactive()) {
library(shiny)
library(shinyMobile)
ui <- f7Page(
f7SingleLayout(
navbar = f7Navbar(title = "updateF7TextArea"),
f7Block(f7Button("trigger", "Click me")),
f7TextArea(
inputId = "textarea",
label = "Text Area",
value = "Lorem ipsum dolor sit amet, consectetur
adipiscing elit, sed do eiusmod tempor incididunt ut
labore et dolore magna aliqua",
placeholder = "Your text here",
resize = TRUE
),
verbatimTextOutput("value")
)
)
server <- function(input, output, session) {
output$value <- renderPrint(input$textarea)
observeEvent(input$trigger, {
updateF7Text("textarea", value = "Updated Text")
})
}
shinyApp(ui, server)
}
# }
Run the code above in your browser using DataLab