Empty FileInput filename and value

I am kind of new to bokeh. I am trying to make a FileInput to import measurement data out of a csv file to be shown in a plot. It is working very well beside one thing. After a file is selected within the FileInput object and all the data is processed and shown in the plot, I would like to empty the FileInput object. The goal is, that the user sees that no file is shown anymore and that he can choose a new one if he likes.
The problem is, that FileInput.filename and FileInput.value are both readonly. Is there a way to reset the field? I tried to declare the FileInput again. It kind of works. If you debug, filename and value are empty, but the UI is stil showing the filename next to the fileinput.
The relevant code looks something like that:

fileinput = FileInput(css_classes=["default", "font-mid-size"],
                    margin=(10,5,0,5),
                    sizing_mode="fixed",
                    width=200,
                    height=30,
                    accept='.csv')

importBT = Button(label='read input file',
                button_type="default",
                css_classes=["button", "font-button-size"],
                sizing_mode="fixed",
                width=250,
                height=80)

def importBTpressed(b):
      content = fileInput.value
      # read content and put it into plot
      [..] # stuff not relevant

      # all data read and imported in plot datasource

      # reset fileInput -> does not work like that
      fileInput.value = ''
      fileInput.filename = ''

importBT.on_click(lambda : importBTpressed(importBT))

I hope it is kind of clear what I like to do.
Thanks for your help!
Cheers,
Niko

There is not currently any way to reset them from Python. Please feel free to open a GitHub development discussion to describe requirements and use-cases that might inform future development.

Thank you very much. I definitly gonna do that.

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.