Hey Folks, I’ve asked this on Stackoverflow but I think here is best 
So, I am not a Web person so forgive-me if this is trivial.
I am trying to create a visualization using bokeh. I am using a custom Jijna template without the default {{ plot_div|indent(8) }} as I have my own schema:
<!-- *CustomCSS -->
<style>
{% include 'plots.css' %}
</style>
<!-- Bokeh -->
{{ bokeh_css }}
{{ bokeh_js }}
{{ bokehPlotsScript | safe }}
{{ bokehSidebarScript | safe}}
<title>{{title}}</title>
<title>Annelida Viewer</title>
</head>
<body>
<div class="container">
<div class="row">
<div class="col-md-2">{{sidebar | safe}}</div>
<div class="col-md-10">{{bokehPlots | safe}}</div>
</div>
</div>
</body>
</html>
``
I add the plots to the template using components:
plotScripts, plotsDiv = createBokehPlot(df)
templateElements = dict(bokehPlotsScript=plotScripts, bokehSidebarScript=sidebarScripts, sidebar = sidebarDiv, bokehPlots = plotsDiv)
curdoc().template_variables.update(templateElements)
``
where createBokehPlot returns a layout with the figure. The sidebar is created in the same manner.
The problem that I have is that by doing this the callbacks from the buttons on the sidebar are not called on the bokeh server side. I think that I have to add my elements to the document with add_root() but I am not sure exactly how. Any suggestions?
Cheers

