I've looked to the documentation and didn't manage to do what I want: I have a box to enter text and I want to evaluate this text only after enter has been pressed (I don't want to evaluate while typing). It'll be even better if this evaluation is done after everytime Enter is press on that box. At the moment I get the following error, so clearly I'm not calling debounce properly (python 3.7.1, dash 0.35.1):
File "dash_layout.py", line 57, in <module>
[Input(component_id='path2file-input',component_property='value',component_debounce=True)],
TypeError: __init__() got an unexpected keyword argument 'component_debounce'
@app.callback(Output(component_id='path2file-output',component_property='children'),
[Input(component_id='path2file-input',component_property='value',component_debounce=True)],
[],
[])
def path2file_callback(input_):
global filename
filename = input_
return File_Info(filename)
def File_Info(filename):
if (filename is None or filename == ""):
return html.Div(
id = 'path2file-output',
children = [
html.H5(
children=['No path to file has been input yet.'],
style={
'textAlign': 'center',
'color': colors['text'],
'fontFamily': 'Roboto Condensed',
'fontSize': '16',
'fontWeight': 'normal',
}
),
])
else:
problem, tester = test_file(filename)
if problem:
return html.Div(
id = 'path2file-output',
children = [
html.H5(
children=['There was an error processing ',filename],
style={
'textAlign': 'center',
'color': colors['text'],
'fontFamily': 'Roboto Condensed',
'fontSize': '16',
'fontWeight': 'normal',
}
),
])
else:
return html.Div(
id = 'path2file-output',
children = [
html.H5(
children=['File: ',filename],
style={
'textAlign': 'center',
'color': colors['text'],
'fontFamily': 'Roboto Condensed',
'fontSize': '16',
'fontWeight': 'normal',
}
),
html.H5(
children=['Tester type: ',tester],
style={
'textAlign': 'center',
'color': colors['text'],
'fontFamily': 'Roboto Condensed',
'fontSize': '16',
'fontWeight': 'normal',
}
),
])
Hi,
I've looked to the documentation and didn't manage to do what I want: I have a box to enter text and I want to evaluate this text only after enter has been pressed (I don't want to evaluate while typing). It'll be even better if this evaluation is done after everytime Enter is press on that box. At the moment I get the following error, so clearly I'm not calling debounce properly (python 3.7.1, dash 0.35.1):
Here is the code I have now:
And the messages:
Thanks fo rany help!