What I’m trying to do:
How can I remove the selected file from FileLoader via code?
For example the form has loaded already the file named: “file1.xlsx” and there were some mistake in the file. So the necessary changes were done, but now if you try to load the same file one more time, it won’t accept it as change.
self.FileLoader.file = None don’t remove it. self.loadr_file.files = None same with files
AttributeError: The 'files' property for a FileLoader is read-only
I’m using FileLoader Change event to start the function on the server side that loads the new data and show it in the form incl. some consistency checks. If they fail, the user need to make changes and load it one more time. I don’t want them to close the form and start it one more time in order to load the corrected file.
You need to open file selection, click abort(file will be removed) and then select it to start the change event.
AttributeError: The ‘files’ property for a FileLoader is read-only
same problem. It’s read-only. The only thing I can think of, would be removing the file loader and re-creating it, but in that case: how is it possible to re-connect it with the previous existing change function?
I wanted only to make the change event hit one more time if the same file is selected.
By selecting a new file with a different name, it will start, but if the file name is the same it won’t. I hoped for some solution to leave it by change event. Now I see there is no other way to force the start with the file named the same.
I will create a new button, that clears the file loader and set it back to enabled.