0

In the same Shiny App, I have two modules, which have a similar architecture with an observeEvent. Both observeEvents update the input fields. In one of the modules this action works just fine. In the other one it does not work for some reason.

  • Both modules have the ns("id") for the inputs.
  • update*Inputs have the session information
  • observeEvents are triggered in both cases
  • There are no errors on the server or browser side, which indicates anything.
  • There are some submodules. If there are some actions in the subsubmodule, then the module update*Input works once.

I think this must be a weird bug but is there any way to even investigate it?

module_ui = function(id){
  ns = NS(id)
  ...
  textInput(ns("textid"), ...)
  ...
}
module_server = function(id){
  moduleServer(id,
    function(input, output, session){
      ...
      observeEvent(reac(), {
        print("trigger indicator")
        updateTextInput(session, "textid", value = reac())
      }
      ...
    }
}
Saren Tasciyan
  • 454
  • 4
  • 15

2 Answers2

0

Given the situation you are describing, i would try printing rec(), i am assuming this is a reactive value, in the observeEvent() to see what its value the updateTextInput is executing.

I suspect there is something up it when it is passed into the observeEvent causing it to set to the same value.

A-A-ron
  • 15
  • 6
0

My mistake, there was an error, which I saw in Firefox but not in RStudio's browser. One of the sub-submodules did not manage to set an input value, which was an empty vector. This blocked the rest of the javascript action. Therefore, no values were displayed.

Lesson: if update*Input does not work, this can be due to unnoticed errors in other modules.

Saren Tasciyan
  • 454
  • 4
  • 15