Python 不带回调状态访问dash应用程序窗体输入值

Python 不带回调状态访问dash应用程序窗体输入值,python,flask,plotly,plotly-dash,Python,Flask,Plotly,Plotly Dash,我正在开发一个dash应用程序,并从用户上传的JSON元数据创建了一个动态表单组。 我的问题是,在用户上传之后,我只有表单输入id,所以我不能在服务器启动时为回调装饰器中的每个输入定义状态id @self.parent_app.callback( Output('output-div', 'children'), [Input('button_submit', component_property='n_clicks')],

我正在开发一个dash应用程序,并从用户上传的JSON元数据创建了一个动态表单组。
我的问题是,在用户上传之后,我只有表单输入id,所以我不能在服务器启动时为回调装饰器中的每个输入定义状态id

@self.parent_app.callback(
            Output('output-div', 'children'),
            [Input('button_submit', component_property='n_clicks')],
            [State("form-input-0", "value"),..., State("form-input-n", "value")] # I can't do this
)
按下“提交”按钮时,我必须访问所有表单数据以创建输出

我的问题是:
还有另一种方法可以访问输入值​​在不使用回调中的状态的情况下访问我的表单?

没有其他直接方法来访问表单的输入值。然而,你应该能够通过网络实现你想要的。你的回电会是这样的

from dash.dependencies import ALL

@self.parent_app.callback(
            Output('output-div', 'children'),
            [Input('button_submit', component_property='n_clicks')],
            [State(dict(name="form-input", idx=ALL), "value")])
动态生成的表单输入应该有表单的ID

dict(name="form-input", idx=i) 

其中,
i
通常是一个整数。

没有其他直接方法可以访问表单的输入值。然而,你应该能够通过网络实现你想要的。你的回电会是这样的

from dash.dependencies import ALL

@self.parent_app.callback(
            Output('output-div', 'children'),
            [Input('button_submit', component_property='n_clicks')],
            [State(dict(name="form-input", idx=ALL), "value")])
动态生成的表单输入应该有表单的ID

dict(name="form-input", idx=i) 

其中,
i
通常是一个整数。

非常感谢。这正是我所需要的!非常感谢你。这正是我所需要的!