Hello,
I am creating an app that takes in values provided in textinput widget and displays it as multiselect widget. Also, i would like to obtain that input as a list variable.
Obtain_ticker_list doesnt capture input from text_input_ticker
import pandas as pd
import numpy as np
import requests
import matplotlib.pyplot as plt
import io
import re
import datetime
from bokeh.layouts import grid,column,row
from bokeh.models import TextInput,PasswordInput,MultiSelect
from bokeh.io import curdoc
ticker_list=[]
def obtain_ticker_list(attr,old,new):
ticker_list=text_input_ticker.value
def activate_ticker_field(attr,old,new):
text_input_ticker.disabled=False
text_input_key=PasswordInput(placeholder='Please enter API key',prefix='Enter API key',value='')
text_input_ticker=TextInput(placeholder='Please enetr coma separated names of ticker',prefix='Ticker',disabled=True,value='')
text_select_ticker=MultiSelect(options=ticker_list,value=['PFE'],visible=True,height=10,width=100)
text_input_key.on_change('value',activate_ticker_field)
text_input_ticker.on_change('value',obtain_ticker_list)
test_layout=grid(row(text_input_key,text_input_ticker,text_select_ticker))
curdoc().add_root(test_layout)
Thanks