Hello,
I want to have a dropdown and textearea value in a function but I have some errors:
layout = html.Div([
dbc.Row(title),
dcc.Dropdown(all_tables, 'report', id='dropdown-table', multi=True, placeholder="Select a source"),
html.Br(),
dcc.Textarea(
id='hosts-list',
value='',
style={'width': '100%', 'height': 200},
),
html.Br(),
html.Button('Search', id='button', n_clicks=0, className='btn-primary'),
html.Br(),
html.Div(id='table-output', style={'whiteSpace': 'pre-line'})
])
@callback(
Output('dropdown-table', 'options'),
Output('dropdown-table', 'value'),
Input('hosts-list', 'value')
)
def update_data(tables_value):
if not tables_value:
raise PreventUpdate
return tables_value
@callback(
Output('table-output', 'children'),
Input('dropdown-table', 'value'),
Input('hosts-list', 'value'),
)
def update_data(tables_value, hosts_value):
return f'You have selected {hosts_value} and {tables_value}'
the erros taht I have:
dash._grouping.SchemaTypeValidationError: Schema: [<Output dropdown-table.options
>, <Output dropdown-table.value
>]
Path: ()
Expected type: (<class ‘tuple’>, <class ‘list’>)
Received value of type <class ‘str’>:
‘test’
the dropdown is there to get the user choice and textearea will be used as a hosts list, then I need to do some queries to generate the output
Any ideas?