-
Notifications
You must be signed in to change notification settings - Fork 74
Open
Labels
DXDeveloper experience issueDeveloper experience issueenhancementNew feature or requestNew feature or requestvaadin-upload
Description
Description
B"H
Hi,
assuming developer block usage to pdf types only,
but customer enforce selections to take lets say 4 file that are not pdf.
rejection event will happened 4 times.
the AllFinished event will happened if and only if at least single file path the validations.
But, what i really want is a single generation of error.
e.g. I have my own error dialog, and i don't want to open it 4 times, only once.
I don't see how I can reach it with current.
consistently get AllFinished event might help in such case.
is there any other way to acheve same?
Expected outcome
A single final event knowing all done,
Minimal reproducible example
upload.addFileRejectedListener(event -> {
if (failMessage == null) {
failMessage = Lists.newArrayList();
}
failMessage.add(event.getFileName() + " - " + event.getErrorMessage());
});
upload.addAllFinishedListener(event ->{
if(failMessage == null || failMessage.isEmpty()) {
logger.debug("All files uploaded successfully.");
//do what need to do
} else {
logger.warn("Some files failed to upload: {}", String.join(", ", failMessage));
//e.g. my notification showError("...", failMessage);
failMessage = null;
}
});Steps to reproduce
- create upload with multiply
- restrict for some type e.g. application/pdf
- load few jpg files
Environment
Vaadin version(s):
OS:
Browsers
No response
Metadata
Metadata
Assignees
Labels
DXDeveloper experience issueDeveloper experience issueenhancementNew feature or requestNew feature or requestvaadin-upload