Learn R Programming

shinyMobile (version 0.1.0)

updateF7Text: Change the value of a text input on the client

Description

Change the value of a text input on the client

Usage

updateF7Text(session, inputId, label = NULL, value = NULL, placeholder = NULL)

Arguments

session

The session object passed to function given to the server.

inputId

The id of the input object.

label

The label to set for the input object.

value

The value to set for the input object.

placeholder

The placeholder to set for the input object.

Examples

Run this code
# NOT RUN {
if (interactive()) {
 library(shiny)
 library(shinyMobile)

 ui <- f7Page(
   f7SingleLayout(
    navbar = f7Navbar(title = "updateF7Text"),
    f7Fab("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(session, "text", value = "Updated Text")
   })
 }
shinyApp(ui, server)
}
# }

Run the code above in your browser using DataLab