Dialog box with bokeh 2.1.1

I keep on reading every blog possible and the closest thing I found is a post saying dialog boxes have been removed because they can be available through 3rd party tools.
I’m struggling with that unfortunately. Is there anyone with a working example?
I have quite a few widgets and ultimately, before plotting I need to make sure all of them contain the right info. And if not, issue a warning message.
How can I achieve that?



There’s a myriad of third-party tools that can do the job. Or you can implement something on your own in JavaScript. Or even just use JavaScript’s alert() if you don’t need fancy UI.
Just to show what I’m talking about - here’s one of such libraries: https://getbootstrap.com/docs/4.0/components/modal/

yes, I tried to use a js_on_event(event.ButtonClick, callback) and then use an alert in it but, if in that callback I check the value of a select widget, I’ll only get the initial value (the one that was set at initialization, not the current one)

I’ll check your link now! thanks

I have to admit I’m pretty green with bokeh, so…bear with me: I can’t find a way to use JavaScript alert when I use button.on_click
the only way to see the alert box is by using js_on_event on the button, but at that point I can’t see the state of any other widget

is there a way to make alert appear from inside a on_click callback?

I think I found a solution:

this works fine


1 Like