title: How to capture the result returned by a callback function call on a Bokeh TextInput widget?
body: <p>I'm working on a Bokeh application which, among other widgets, has a <code>TextInput</code> and a <code>MultiSelect</code>. (Since Bokeh does not have a native Search widget, I try to build one that has a box for input and a box to display the results returned by a dB query based on the input field.)</p>
  
  <p>The code for <code>TextInput</code> box is <code>ask_fruit</code> and <code>MultiSelect</code> is used to display the results returned by dB query.
  The <code>callback</code> function used by <code>TextInput</code> is <code>db_query</code>.</p>
  
  <pre><code>def SearchDisplay():
      ask_fruit = TextInput(value="Enter fruit name here",
                          title="Input box:"
                          )
  
      ask_fruit.on_change("value", db_query)
  
      available_fruits = MultiSelect(title=None,
                             value=["All"],
                             options=[]
                             )
  
      return [ask_fruit, available_fruits]
  
  
  
  def db_query(attr, old, new):
  
      #conn = pyodbc.connect('fruit-db', autocommit=True)
      #curs = conn.cursor()
      #query = "select fruit_id from fruitdB"
      #curs.execute(query)
      #fruit_list = curs.fetchall()
  
      fruit_list = ["Fuji", "Gala", "McIntosh"] 
  
      return fruit_list
  </code></pre>
  
  <p>The question is how to populate the <code>MultiSelect</code> widget with results returned by the callback?</p>
  
  <p>Is it possible to just do <code>options=[ask_fruit.on_change("value", db_query)]</code>  in code for <code>MultiSelect</code>?</p>
  
  <p>The action would look like this:</p>
  
  <p><a href="https://i.stack.imgur.com/S9rMZ.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/S9rMZ.png" alt="enter image description here"></a></p>