Checklist doesn't work?

Hello, I’m a little bit in short. I try to study Dash, however something seems strange:
This returns:
dcc.Checklist(
id=‘studies’,
options=[
{‘label’: ‘Accumulation/D’, ‘value’: ‘accumulation_trace’},
{‘label’: ‘Bollinger bands’, ‘value’: ‘bollinger_trace’},
{‘label’: ‘MA’, ‘value’: ‘moving_average_trace’},
{‘label’: ‘EMA’, ‘value’: ‘e_moving_average_trace’},
{‘label’: ‘CCI’, ‘value’: ‘cci_trace’},
{‘label’: ‘ROC’, ‘value’: ‘roc_trace’},
{‘label’: ‘Pivot points’, ‘value’: ‘pp_trace’},
{‘label’: ‘Stochastic oscillator’,‘value’: ‘stoc_trace’},
{‘label’: ‘Momentum indicator’,‘value’: ‘mom_trace’}
],
values=[‘moving_average_trace’],
labelStyle={‘display’: ‘block’}
),

RETURNS:
You’ve entered “None”

HOWEVER:
The RadioItems version seems correct (“moving_average_trace”):
dcc.RadioItems(
id=‘studies’,
options=[
{‘label’: ‘Accumulation/D’, ‘value’: ‘accumulation_trace’},
{‘label’: ‘Bollinger bands’, ‘value’: ‘bollinger_trace’},
{‘label’: ‘MA’, ‘value’: ‘moving_average_trace’},
{‘label’: ‘EMA’, ‘value’: ‘e_moving_average_trace’},
{‘label’: ‘CCI’, ‘value’: ‘cci_trace’},
{‘label’: ‘ROC’, ‘value’: ‘roc_trace’},
{‘label’: ‘Pivot points’, ‘value’: ‘pp_trace’},
{‘label’: ‘Stochastic oscillator’,‘value’: ‘stoc_trace’},
{‘label’: ‘Momentum indicator’,‘value’: ‘mom_trace’}
],
value=‘moving_average_trace’,
labelStyle={‘display’: ‘block’}
),

Many thanks.
Vaclav

Just being complex, the callback is this one:
@app.callback(Output(‘contain’, ‘children’),
[Input(‘studies’, ‘value’)])

def test(stud_traces):
return ‘You’ve entered “{}”’.format(stud_traces)

Vaclav

@vaclavku values for checklist and value in raidoitem, you need to change the second parameter in callback.

Hello @byronz,
yes, thanks. The second callback was with values instead of the value.
However, great lessons learnt is that it was possible about the IDE I use for testing (Spyder).
I restarted PC to fix the issue = success.

Cheers,
Vaclav

Just a note for anyone who hits this in the future: Dash 1.0 changes Checklist to use value like everything else, not values like it did before.

1 Like