I’m using the upload component to load a file, on which I do some processing and save it as a blob to a DB.
I want to display an errormessage if the user has no file selected, but presses the upload button anyway. How can I check if the textfield of the Upload component is not empty? In other words, how can I check the user selected a file?
I’d use an upload in “immediate” mode and a separate “Process my file” button. It would both solve this issue and save some waiting from the users as the upload starts immediately.
Thanks for your responds. Unfortunalty can’t use the immediate functionality. The user requirements ask for the possibility to type the pathname and filename in stead of selecting is. So I need the textfield, but I also need to check if it is filled.
I’ve got the same issue as Jolanda!
Immediate upload has hard times to cooperate with our testers.
Can we count on changing the upload component in future?
Vaadin is open source software and as a general rule, you can’t “count on” any particular change being implemented - especially is it is not in the roadmap. On the contrary, you can usually count on nothing happening about such enhancements (probably only affecting a small number of users) if there is no ticket about it.
An enhancement request with a good description and maybe even a high quality patch (taking into consideration the point of view of all users, not only your particular use case) can help get it included. Please
create an enhancement request about this (with a good description and maybe also a link to this forum thread).
If you subscribe to the
Pro Account (commercial product), you also get to vote on the enhancement requests that matter the most for you. You can also
contact us if you want to sponsor its development.