How to clear Upload-component after successful upload?


I have an upload-component in my application, which retains the file-path after the file has been uploaded. This confuses my users. I need a way to clear the path, but I don’t find a suitable method to do it … I know that this is no easy task, as the upload-element of HTML is guarded by the browser (as it has access to the client’s filesystem), but there are several ways to achieve this using Javascript. Is one of these ways built in into Vaadin and how do I use it? Is there another way how I can achieve my goal? I would like to not newly create the upload-component every time as this doesn’t fit to well into my current architecture.

kind regards

What about giving a visual feedback by changing the button caption? (setButtonCaption method)

Interesting thought, but as my users want to reuse the component for directly uploading the next file, it wouldn’t be sufficient. I think I will have to recreate the component then …

In my application, I have a extended CustomField to embed the Upload component (actually I have extended the Upload too to do a bit of customization) in it so that I can provide extra features. In my case, the uploaded file is stored in a database and it is part of the transaction. Within the CustomField, buttons are provided to view the content, remove the content, or upload new content.

Was there ever a response to this? It seems like a problem that should have an easy fix, but I can’t figure this out either.