|Setting inputs from the server||Winston Chang||4/10/13 10:50 AM|
Hi everyone -
We've added some new features on an experimental branch:
* Setting the values of input objects from the server
It's not yet merged into the master development branch, but if you are feeling brave and want to experiment with it, you can install it with:
devtools::install_github('shiny', 'wch', 'set-input')
Please note that the API is still subject to change, and it's possible that this branch could break at any time. If you do play with it and have feedback about it works, we'd like to hear it!
Here's a demo of setting inputs:
|Re: Setting inputs from the server||Alberto Santini||4/11/13 3:20 AM|
This is an interesting and useful feature to develop, for instance, "converters" as the example below.
|Re: Setting inputs from the server||Winston Chang||4/11/13 10:58 AM|
Yes, it should make this kind of functionality easier and more elegant to implement. It was already possible to "set" an input by sending a dynamic UI object (which replaces the original), but the new method is much cleaner. Instead of replacing the UI, it just tells the UI object to change values.
|Re: Setting inputs from the server||Dieter Menne||4/15/13 9:27 AM|
This is great news, Winston, it make editable field usable at last, and enabling/disabling of button easier.
There is one minor problem in the example posted on gist (forgot how I get access to glimmer, but feel free to do so). It's described in the application window.
A revised and much better
is available now on
Requires developer version 0.5 of Shiny
|Re: Setting inputs from the server||Mike C||4/15/13 10:30 AM|
This is fantastic. I really like the direction this is going in, my only regret is that I am almost finished my app the old fashioned way! :)
One quick question, can isolate and action buttons be applied to the session observations? ie:
return() #make it NULL initially
x <- isolate(input$controller)#only update x each time the goButtonx is pressed
updateTextInput(session, "inText", value = paste("New text", x)) #only updates when goButtonx is pressed})
|Re: Setting inputs from the server||Mike C||4/16/13 6:45 AM|
Sorry for following up with another question before the first was answered, but I noticed that the setup still seemed 'hard coded' in terms of how many options were available for each field (in this example, usually 2 options in drop down menus and radial buttons). Is it dynamicUI still the tool to use to get a variable number of inputs in a given field?
|Re: Setting inputs from the server||Winston Chang||4/16/13 8:33 AM|
You should be able to add as many options as you want. In the demo, I just put two options for each group because it was simpler to code.
|Re: Setting inputs from the server||Winston Chang||4/16/13 8:35 AM|
This should work - the updaters work just like any other functions.
|Re: Setting inputs from the server||Winston Chang||4/16/13 8:45 AM|
Very nice. We're also looking at adding the capability for sending arbitrary JSON messages to the client; and then on the client, making it easy to add callbacks that will receive the JSON message.
|Re: Setting inputs from the server||Paul Rigor||6/28/13 11:22 AM|
Just wanted to follow up on whether the changes discussed in this thread have made it to the main branch?
|Re: Setting inputs from the server||Yuan Yuan||6/28/13 11:55 AM|
This is very cool! Thanks, Winston and the team.
|Re: Setting inputs from the server||Winston Chang||6/28/13 12:09 PM|