admin管理员组文章数量:1122832
I have a Shiny for Python app that uses ui.input_file()
and ui.download_button()
. For most of the UI Inputs there exists a corresponding ui.update_...()
with that you can activate/deactivate a button (ui.update_action_button(id="some_id", disabled=False)
or simply undo and made input (ui.update_text("some_other_id", value='')
).
Is there a way to clear the selected file in an ui.input_file()
input or to enable disable an ui.download_button
? I know these are two questions, but they are so closely related that I didn't want to make this two questions.
I have a Shiny for Python app that uses ui.input_file()
and ui.download_button()
. For most of the UI Inputs there exists a corresponding ui.update_...()
with that you can activate/deactivate a button (ui.update_action_button(id="some_id", disabled=False)
or simply undo and made input (ui.update_text("some_other_id", value='')
).
Is there a way to clear the selected file in an ui.input_file()
input or to enable disable an ui.download_button
? I know these are two questions, but they are so closely related that I didn't want to make this two questions.
1 Answer
Reset to default 0For the file input, generate it in the server and then you can reset it when you like:
from shiny import App, render, ui, reactive
app_ui = ui.page_fluid(
ui.input_action_button("reset_input", "Reset Input"),
ui.output_ui("dynamic_input"),
)
def server(input, output, session):
@output
@render.ui
def dynamic_input():
input.reset_input()
return ui.input_file("file1", "Choose a file")
app = App(app_ui, server)
There should in theory be several ways to disable a download button, but I can't get anything to work.
本文标签: Is there an uiupdateinputfile and uiupdatedownloadbutton in Shiny for PythonStack Overflow
版权声明:本文标题:Is there an ui.update_input_file and ui.update_download_button in Shiny for Python? - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1736308080a1933535.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论