Widget | R Documentation |
A Widget
object represents a Shiny input or output control, and provides
methods for finer grained interaction.
new()
Create new Widget
Widget$new(name, element, type, iotype = c("input", "output"))
name
Name of a Shiny widget.
element
webdriver::Element
type
Widget type
iotype
Input/output type.
getName()
Control id (i.e. inputId
or outputId
that control
was created with).
Widget$getName()
getElement()
Underlying webdriver::Element()
object.
Widget$getElement()
getHtml()
retrieve the underlying HTML for a widget
Widget$getHtml()
getType()
Widget type, e.g. textInput
, selectInput
.
Widget$getType()
getIoType()
Is this an input or output control?
Widget$getIoType()
isInput()
Is this an input control?
Widget$isInput()
isOutput()
Is this an output control?
Widget$isOutput()
getValue()
Get current value of control.
Widget$getValue()
setValue()
Set value of control.
Widget$setValue(value)
value
Value to set for the widget.
click()
scrolls the element into view, then clicks the in-view centre point of it.
Widget$click()
self, invisibly.
sendKeys()
Send specified key presses to control.
Widget$sendKeys(keys)
keys
Keys to send to the widget or the app. See webdriver::key for how to specific special keys.
listTabs()
Lists the tab names of a shiny::tabsetPanel()
.
It fails for other types of widgets.
Widget$listTabs()
uploadFile()
Upload a file to a shiny::fileInput()
.
It fails for other types of widgets.
Widget$uploadFile(filename)
filename
Path to file to upload
clone()
The objects of this class are cloneable with this method.
Widget$clone(deep = FALSE)
deep
Whether to make a deep clone.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.