cancel
Showing results for 
Search instead for 
Did you mean: 

Problem with UploadCollection when multiple: true

lucy-dev
Discoverer
0 Kudos
283

Hello,

I've been trying to use UploadCollection with multiple: true. Before when it was false everything worked fine but since changing to true it started to give this error. I thought it was in uploadComplete but I commented the code inside and it still gave me this error.

I've checked and when using multiple: true while on the uploadComplete function they use the destroy call from ManagedObject-dbg.js which has the error. But with multiple: false we use the Element destroy() and they don't have this error.

So what should I do?

UploadCollection-dbg.js code:

ManagedObject-dbg.js code:

Accepted Solutions (0)

Answers (2)

Answers (2)

lucy-dev
Discoverer
0 Kudos
handleUploadComplete (oEvent) {
		
    //ommited initializations etc
    
    var fileReader = new FileReader();

   fileReader.onload = function(oEvent) {
			//put something inside an array


		};


		fileReader.onloadend = function(oEvent) {
		    
			array.unshift({
				"documentId": id, // generate Id,
				"fileName": nameFile,
				"mimeType": fileType,
				"thumbnailUrl": "",
				"url": "",
				"attributes": [
					{
						"title": "Uploaded By",
						"text": personName
					},
					{
						"title": "Uploaded On",
						"text": new Date(jQuery.now()).toLocaleDateString()
					},
					{
						"title": "File Size",
						"text": fileSize
					},
					],
				"statuses": [
					{
						"title": "",
						"text": "",
						"state": "None"
					}
				],
				"markers": [
					{}
				],
				"selected": true
			});


		}
		fileReader.readAsDataURL(file);
}

Hello Reshma,

The problem isn't solved yet. But I noticed something interesting, works perfectly if I have a breaking point. I think the problem is when I'm reading the file... I tried working it out with Promises but it still doesn't work. Nothing works...

Thank you

0 Kudos

Hi Lucy,

Please let us know if you are still facing this issue. In the samples : https://sapui5.hana.ondemand.com/#/entity/sap.m.UploadCollection/sample/sap.m.sample.UploadCollectio... where multiple is set to true I saw that there were no console errors on uploadComplete.

If it is still reproducible it would be good to have a jsFiddle sample code to see how you have implemented Upload Collection.

Regards,

Reshma