Dialog error message

I would like to pop up a dialog box when someone clicks a button. I have found the Dialog widget but I have no clue how to make it appear on the webpage, does someone have an example?

Thanks

I don’t have an example for you but you can have this dialog sitting on the page but with a “display: none” and then show it via a JS onClick function.

···

On Thursday, September 8, 2016 at 2:56:02 PM UTC-4, Trampas Stern wrote:

I would like to pop up a dialog box when someone clicks a button. I have found the Dialog widget but I have no clue how to make it appear on the webpage, does someone have an example?

Thanks

This might be the best route for now. I believe the layout overhaul in 0.12 may have left the Bokeh Dialog widget with some bugs to resolve.

Thanks,

Bryan

···

On Sep 8, 2016, at 1:59 PM, Reuben Jacobs <[email protected]> wrote:

I don't have an example for you but you can have this dialog sitting on the page but with a "display: none" and then show it via a JS onClick function.

On Thursday, September 8, 2016 at 2:56:02 PM UTC-4, Trampas Stern wrote:
I would like to pop up a dialog box when someone clicks a button. I have found the Dialog widget but I have no clue how to make it appear on the webpage, does someone have an example?

Thanks

--
You received this message because you are subscribed to the Google Groups "Bokeh Discussion - Public" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit https://groups.google.com/a/continuum.io/d/msgid/bokeh/d147f98c-b46b-4704-82b4-718cf0ab589c%40continuum.io\.
For more options, visit https://groups.google.com/a/continuum.io/d/optout\.

I might be using the wrong tool…

What I am trying to do is create a user interface that allows me start some tests. The tests run and put data in a database, then I also want to graph the results (ie data analytics) and present on web interface. Bokeh appears to allow most of this to happen, but I keep running into problems like the dialogs message box not working and tabs not working. Could someone recommend another tool or set of tools?

I do not know javascript nor have I mastered HTML. I can learn, but prefer to stay in Python if possible.

···

On Thu, Sep 8, 2016 at 3:00 PM, Bryan Van de Ven [email protected] wrote:

This might be the best route for now. I believe the layout overhaul in 0.12 may have left the Bokeh Dialog widget with some bugs to resolve.

Thanks,

Bryan

On Sep 8, 2016, at 1:59 PM, Reuben Jacobs [email protected] wrote:

I don’t have an example for you but you can have this dialog sitting on the page but with a “display: none” and then show it via a JS onClick function.

On Thursday, September 8, 2016 at 2:56:02 PM UTC-4, Trampas Stern wrote:

I would like to pop up a dialog box when someone clicks a button. I have found the Dialog widget but I have no clue how to make it appear on the webpage, does someone have an example?

Thanks

You received this message because you are subscribed to the Google Groups “Bokeh Discussion - Public” group.

To unsubscribe from this group and stop receiving emails from it, send an email to [email protected].

To post to this group, send email to [email protected].

To view this discussion on the web visit https://groups.google.com/a/continuum.io/d/msgid/bokeh/d147f98c-b46b-4704-82b4-718cf0ab589c%40continuum.io.

For more options, visit https://groups.google.com/a/continuum.io/d/optout.

You received this message because you are subscribed to the Google Groups “Bokeh Discussion - Public” group.

To unsubscribe from this group and stop receiving emails from it, send an email to [email protected].

To post to this group, send email to [email protected].

To view this discussion on the web visit https://groups.google.com/a/continuum.io/d/msgid/bokeh/511F4284-739F-4551-B136-C1D8F3B94B48%40continuum.io.
For more options, visit https://groups.google.com/a/continuum.io/d/optout.

Here is a crude simple example of what I am trying to do. Basically when user hits a button I want to validate the data they entered and pop up a “dialog” or an alert that lets them know what mistake they had.
I found that javascript has the alert() function, but I could not find in the Boken documentation how to call from the python function.

import bokeh

from bokeh.io import show

from bokeh.client import push_session

from bokeh.driving import cosine

from bokeh.plotting import Figure, curdoc

from bokeh.models.widgets import Select

from bokeh.models import ColumnDataSource, HBox, WidgetBox,CustomJS

from bokeh.models.widgets import Slider, TextInput, Toggle, Dialog, Tabs, Panel

from cathodedb import cathodedb

import re

def button_click(something):

if (descInput.value==“”):

txt= “you must enter a value”

how do I pop up a error message on web page???

print txt

return

descInput=TextInput(title=“Test Description”)

startButton = Toggle(label=“Start Test”, button_type=“success”)

startButton.on_click(button_click)

inputs = WidgetBox(children=[descInput,startButton])

curdoc().add_root(HBox(children=[inputs], width=1000))

session = push_session(curdoc())

session.show() # open the document in a browser

session.loop_until_closed() # run forever

···

On Thu, Sep 8, 2016 at 4:25 PM, Trampas Stern [email protected] wrote:

I might be using the wrong tool…

What I am trying to do is create a user interface that allows me start some tests. The tests run and put data in a database, then I also want to graph the results (ie data analytics) and present on web interface. Bokeh appears to allow most of this to happen, but I keep running into problems like the dialogs message box not working and tabs not working. Could someone recommend another tool or set of tools?

I do not know javascript nor have I mastered HTML. I can learn, but prefer to stay in Python if possible.

On Thu, Sep 8, 2016 at 3:00 PM, Bryan Van de Ven [email protected] wrote:

This might be the best route for now. I believe the layout overhaul in 0.12 may have left the Bokeh Dialog widget with some bugs to resolve.

Thanks,

Bryan

On Sep 8, 2016, at 1:59 PM, Reuben Jacobs [email protected] wrote:

I don’t have an example for you but you can have this dialog sitting on the page but with a “display: none” and then show it via a JS onClick function.

On Thursday, September 8, 2016 at 2:56:02 PM UTC-4, Trampas Stern wrote:

I would like to pop up a dialog box when someone clicks a button. I have found the Dialog widget but I have no clue how to make it appear on the webpage, does someone have an example?

Thanks

You received this message because you are subscribed to the Google Groups “Bokeh Discussion - Public” group.

To unsubscribe from this group and stop receiving emails from it, send an email to [email protected].

To post to this group, send email to [email protected].

To view this discussion on the web visit https://groups.google.com/a/continuum.io/d/msgid/bokeh/d147f98c-b46b-4704-82b4-718cf0ab589c%40continuum.io.

For more options, visit https://groups.google.com/a/continuum.io/d/optout.

You received this message because you are subscribed to the Google Groups “Bokeh Discussion - Public” group.

To unsubscribe from this group and stop receiving emails from it, send an email to [email protected].

To post to this group, send email to [email protected].

To view this discussion on the web visit https://groups.google.com/a/continuum.io/d/msgid/bokeh/511F4284-739F-4551-B136-C1D8F3B94B48%40continuum.io.
For more options, visit https://groups.google.com/a/continuum.io/d/optout.

So what I have done is make an empty string text using Div as shown below, I wish there was a way to change the color to red but I could not find any way to change the style.
I figure there is way in Bokeh to just output HTML but the documentation is sparse.

import bokeh

from bokeh.io import show

from bokeh.client import push_session

from bokeh.driving import cosine

from bokeh.plotting import Figure, curdoc

from bokeh.models.widgets import Select

from bokeh.models import ColumnDataSource, HBox, WidgetBox,CustomJS

from bokeh.models.widgets import Slider, TextInput, Toggle, Dialog, Tabs, Panel,Div

from cathodedb import cathodedb

import re

def button_click(something):

if (descInput.value==“”):

error.text= “you must enter a value”

return

descInput=TextInput(title=“Test Description”)

startButton = Toggle(label=“Start Test”, button_type=“success”)

startButton.on_click(button_click)

error=Div(text=“”)

inputs = WidgetBox(children=[error,descInput,startButton])

curdoc().add_root(HBox(children=[inputs], width=1000))

session = push_session(curdoc())

session.show() # open the document in a browser

session.loop_until_closed() # run forever

···

On Thu, Sep 8, 2016 at 5:10 PM, Trampas Stern [email protected] wrote:

Here is a crude simple example of what I am trying to do. Basically when user hits a button I want to validate the data they entered and pop up a “dialog” or an alert that lets them know what mistake they had.
I found that javascript has the alert() function, but I could not find in the Boken documentation how to call from the python function.

import bokeh

from bokeh.io import show

from bokeh.client import push_session

from bokeh.driving import cosine

from bokeh.plotting import Figure, curdoc

from bokeh.models.widgets import Select

from bokeh.models import ColumnDataSource, HBox, WidgetBox,CustomJS

from bokeh.models.widgets import Slider, TextInput, Toggle, Dialog, Tabs, Panel

from cathodedb import cathodedb

import re

def button_click(something):

if (descInput.value==“”):

txt= “you must enter a value”

how do I pop up a error message on web page???

print txt

return

descInput=TextInput(title=“Test Description”)

startButton = Toggle(label=“Start Test”, button_type=“success”)

startButton.on_click(button_click)

inputs = WidgetBox(children=[descInput,startButton])

curdoc().add_root(HBox(children=[inputs], width=1000))

session = push_session(curdoc())

session.show() # open the document in a browser

session.loop_until_closed() # run forever

On Thu, Sep 8, 2016 at 4:25 PM, Trampas Stern [email protected] wrote:

I might be using the wrong tool…

What I am trying to do is create a user interface that allows me start some tests. The tests run and put data in a database, then I also want to graph the results (ie data analytics) and present on web interface. Bokeh appears to allow most of this to happen, but I keep running into problems like the dialogs message box not working and tabs not working. Could someone recommend another tool or set of tools?

I do not know javascript nor have I mastered HTML. I can learn, but prefer to stay in Python if possible.

On Thu, Sep 8, 2016 at 3:00 PM, Bryan Van de Ven [email protected] wrote:

This might be the best route for now. I believe the layout overhaul in 0.12 may have left the Bokeh Dialog widget with some bugs to resolve.

Thanks,

Bryan

On Sep 8, 2016, at 1:59 PM, Reuben Jacobs [email protected] wrote:

I don’t have an example for you but you can have this dialog sitting on the page but with a “display: none” and then show it via a JS onClick function.

On Thursday, September 8, 2016 at 2:56:02 PM UTC-4, Trampas Stern wrote:

I would like to pop up a dialog box when someone clicks a button. I have found the Dialog widget but I have no clue how to make it appear on the webpage, does someone have an example?

Thanks

You received this message because you are subscribed to the Google Groups “Bokeh Discussion - Public” group.

To unsubscribe from this group and stop receiving emails from it, send an email to [email protected].

To post to this group, send email to [email protected].

To view this discussion on the web visit https://groups.google.com/a/continuum.io/d/msgid/bokeh/d147f98c-b46b-4704-82b4-718cf0ab589c%40continuum.io.

For more options, visit https://groups.google.com/a/continuum.io/d/optout.

You received this message because you are subscribed to the Google Groups “Bokeh Discussion - Public” group.

To unsubscribe from this group and stop receiving emails from it, send an email to [email protected].

To post to this group, send email to [email protected].

To view this discussion on the web visit https://groups.google.com/a/continuum.io/d/msgid/bokeh/511F4284-739F-4551-B136-C1D8F3B94B48%40continuum.io.
For more options, visit https://groups.google.com/a/continuum.io/d/optout.

Hi Trampas, you’ll need to manually style it I’m afraid - although
I think it’s a good feature request - so feel free to open an
issue.

For now though, this should work

  error.text= """<span style="color: red">you must enter a

value“”"

HTH, Bird

···

On 9/9/16 4:41 AM, Trampas Stern wrote:

    So what I have done is make an empty string text

using Div as shown below, I wish there was a way to change the
color to red but I could not find any way to change the style.
I figure there is way in Bokeh to just output HTML but the
documentation is sparse.

import bokeh

from bokeh.io
import show

from bokeh.client import push_session

from bokeh.driving import cosine

from bokeh.plotting import Figure, curdoc

from bokeh.models.widgets import Select

          from bokeh.models import ColumnDataSource, HBox,

WidgetBox,CustomJS

          from bokeh.models.widgets import Slider, TextInput,

Toggle, Dialog, Tabs, Panel,Div

from cathodedb import cathodedb

import re

def button_click(something):

if (descInput.value==“”):

error.text= “you must enter a value”

return

descInput=TextInput(title=“Test Description”)

          startButton = Toggle(label="Start Test",

button_type=“success”)

startButton.on_click(button_click)

error=Div(text=“”)

          inputs =

WidgetBox(children=[error,descInput,startButton])

curdoc().add_root(HBox(children=[inputs], width=1000))

session = push_session(curdoc())

session.show() # open the document in a browser

session.loop_until_closed() # run forever

      On Thu, Sep 8, 2016 at 5:10 PM, Trampas

Stern [email protected]
wrote:

          Here is a crude simple example of what I am

trying to do. Basically when user hits a button I want to
validate the data they entered and pop up a “dialog” or an
alert that lets them know what mistake they had.
I found that javascript has the alert() function, but
I could not find in the Boken documentation how to call
from the python function.

import bokeh

from bokeh.io
import show

from bokeh.client import push_session

from bokeh.driving import cosine

from bokeh.plotting import Figure, curdoc

from bokeh.models.widgets import Select

                from bokeh.models import ColumnDataSource, HBox,

WidgetBox,CustomJS

                from bokeh.models.widgets import Slider,

TextInput, Toggle, Dialog, Tabs, Panel

from cathodedb import cathodedb

import re

def button_click(something):

if (descInput.value==“”):

txt= “you must enter a value”

                # how do I pop up a error message on web

page???

print txt

return

descInput=TextInput(title=" Test
Description")

                startButton = Toggle(label="Start Test",

button_type=“success”)

startButton.on_click(button_click)

inputs = WidgetBox(children=[descInput,startButton])

curdoc().add_root(HBox( children=[inputs],
width=1000))

session = push_session(curdoc())

session.show() # open the document in a browser

session.loop_until_closed() # run forever

                On Thu, Sep 8, 2016 at 4:25

PM, Trampas Stern [email protected]
wrote:

I might be using the wrong tool…

                      What I am trying to do is create a user

interface that allows me start some tests. The
tests run and put data in a database, then I
also want to graph the results (ie data
analytics) and present on web interface.
Bokeh appears to allow most of this to happen,
but I keep running into problems like the
dialogs message box not working and tabs not
working. Could someone recommend another tool
or set of tools?

                      I do not know javascript nor have I

mastered HTML. I can learn, but prefer to stay
in Python if possible.

                          On Thu, Sep 8, 2016

at 3:00 PM, Bryan Van de Ven [email protected]
wrote:

                            This might

be the best route for now. I believe the
layout overhaul in 0.12 may have left
the Bokeh Dialog widget with some bugs
to resolve.

                            Thanks,



                            Bryan


                                > On Sep 8, 2016, at 1:59 PM,

Reuben Jacobs <[email protected] >
wrote:

                                >

                                > I don't have an example for you

but you can have this dialog sitting
on the page but with a “display:
none” and then show it via a JS
onClick function.

                                >

                                > On Thursday, September 8, 2016

at 2:56:02 PM UTC-4, Trampas Stern
wrote:

                                > I would like to pop up a dialog

box when someone clicks a button. I
have found the Dialog widget but I
have no clue how to make it appear
on the webpage, does someone have an
example?

                                >

                                > Thanks

                                >

                                > --

                                > You received this message

because you are subscribed to the
Google Groups “Bokeh Discussion -
Public” group.

                                > To unsubscribe from this group

and stop receiving emails from it,
send an email to [email protected].

                                > To post to this group, send

email to [email protected].

                                > To view this discussion on the

web visit https://groups.google.com/a/continuum.io/d/msgid/bokeh/d147f98c-b46b-4704-82b4-718cf0ab589c%40continuum.io.

                                > For more options, visit [https://groups.google.com/a/continuum.io/d/optout](https://groups.google.com/a/continuum.io/d/optout).



                                --

                                You received this message because

you are subscribed to the Google
Groups “Bokeh Discussion - Public”
group.

                                To unsubscribe from this group and

stop receiving emails from it, send
an email to [email protected].

                                To post to this group, send email to

[email protected].

                            To view this discussion on the web visit

https://groups.google.com/a/continuum.io/d/msgid/bokeh/511F4284-739F-4551-B136-C1D8F3B94B48%40continuum.io.
For more options, visit https://groups.google.com/a/continuum.io/d/optout.

  You received this message because you are subscribed to the Google

Groups “Bokeh Discussion - Public” group.

  To unsubscribe from this group and stop receiving emails from it,

send an email to [email protected].

  To post to this group, send email to [email protected].

  To view this discussion on the web visit [https://groups.google.com/a/continuum.io/d/msgid/bokeh/CADqjcygPpx_ja0iTaGLFw3oYT-XTttdNNUfJ55DVBANCNZ9JAg%40mail.gmail.com](https://groups.google.com/a/continuum.io/d/msgid/bokeh/CADqjcygPpx_ja0iTaGLFw3oYT-XTttdNNUfJ55DVBANCNZ9JAg%40mail.gmail.com?utm_medium=email&utm_source=footer).

  For more options, visit [https://groups.google.com/a/continuum.io/d/optout](https://groups.google.com/a/continuum.io/d/optout).


Sarah Bird
Developer, Bokeh

    [
      ![Continuum Analytics](http://docs.continuum.io/_static/img/ContinuumWordmark.png)
    ](http://continuum.io)