I\'m trying to create and use shiny modules inside a shinydashboard app but I keep getting this error:
Error in FUN(X[[i]], ...) : Expected an object with cl
Problem with shinydashboard and tagList
As described here
You need simple use
ui <- dashboardPage(
dashboardHeader(
title = "Shiny modules and shinydashboard"
),
dashboardSidebar(
sidebarMenu(
menuItem("PointA",tabName = "PointA")
)
),
dashboardBody(
tags$div( fooUI("myid"), class = "tab-content" )
)
)
You also need tabName in menuItem
menuItem("PointA_",tabName = "PointA")
As you can see
tabItems
function (...)
{
lapply(list(...), tagAssert, class = "tab-pane")
div(class = "tab-content", ...)
}
use list to ... and cant work if you already have list as arg.
So other variant it create new tabItems function like
tabItems1=function (...)
{
lapply(..., tagAssert, class = "tab-pane")
div(class = "tab-content", ...)
}
environment(tabItems1)=environment(tabItems)
And then you can use tabItems1 with tagList