Shiny.setInputValue in modular app with namespaces


#1

I am able to use Shiny.setInputValue() in an app.R file with no issues to let Javascript modify inputs and trigger events back in R. However, if I have a modular application this has no effect on the inputs which are created within a namespace. Does anyone know how (or if) I can indicate on the call to Siny.setInputValue that the input is within a specific namespace? Hoping something like the namespace as a prefix to the variable or something simple such as this.

Thanks!


#2

To reference an input id via setInputValue in a modular app that uses namespaces, simply add the namespace id in front of the input id, separated by a dash. Example:

Shiny.setInputValue("the_namespace_id-serial","new value");  // Report the change to Shiny