rstudio/shiny — pull request #127 by wch (2013-03-20 02:02:59+00:00)
Title: Set input

This is a basic framework for setting input values. It would be used like this:

```R
# ==== in server.r ====
# Set input values based on query string
output$setInputs <- inputSetterHandler({
values <- list()
query <- parseQueryString(clientData$url_search)

if (!is.null(query$n))
values <- c(values, n = query$n)

values
})

# ==== in ui.r ====
# This goes somewhere on the page
inputSetter("setInputs")
```

Example app at: https://gist.github.com/wch/5201731

```
runGist(5201731)

```
After it starts, set the browser's URL to: http://localhost:8100/?n=200

Notes:

* Doesn't yet work for selectInputs or tabInputs (and probably others like checkboxes). The input bindings for these will have to be modified to work with this method.