【问题标题】:Shiny does not render uiOutput data in modulesShiny 不会在模块中呈现 uiOutput 数据
【发布时间】:2020-02-15 10:14:48
【问题描述】:

我有这个代码:

columnSelectorUI <- function(id) {
  ns <- NS(id)
  return(
    wellPanel(
      h4("Select columns"),
      uiOutput(ns("tab"))
    ))
}

columnSelectorServer <- function(input, output, session) {
  print("XXX")
  state <- reactiveValues()
  print(renderUI({h2("hello")}))
  print(output)
  output$tab <- renderUI({div(HTML("hello"))})
}

我看到的是:

  • 打印了XXX,所以调用了服务器函数
  • 渲染了 h4“选定的列”
  • 渲染了 uiOutput 元素,但没有渲染其内容。

&lt;div id="columnSelector-tab" class="shiny-html-output shiny-bound-output"&gt;&lt;/div&gt;

【问题讨论】:

    标签: r shiny


    【解决方案1】:

    已解决:当顶层小部件调用 UI 组件时,我错过了 ns() 调用。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2021-05-05
      • 1970-01-01
      • 2019-03-14
      • 1970-01-01
      • 2018-12-04
      • 1970-01-01
      • 2017-09-29
      • 1970-01-01
      相关资源
      最近更新 更多