cancel
Showing results for 
Search instead for 
Did you mean: 

Problem with UploadCollection when multiple: true

lucy-dev
Discoverer
0 Kudos

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:

lenastodal
Product and Topic Expert
Product and Topic Expert
0 Kudos

Hi Lucy,

Thank you for visiting SAP Community to get answers to your questions. I am here to help you to get the most out of it.

First of all, I recommend that you familiarize yourself with https://community.sap.com/resources/questions-and-answers (if you haven't done so already), as it provides tips for preparing questions that draw responses from our members.

Please also make sure you're using all appropriate tags, so the right experts can find your question. Overall, the more details you provide, the more likely it is that members will be able to assist you. Should you wish, you can revise your question by selecting Actions, then Edit (although once someone answers your question, you'll lose the ability to edit the question - but if that happens, you can leave more details in a comment).

Finally, if you're hoping to connect with readers, please consider adding a picture to your profile. Here's how you do it: https://www.youtube.com/watch?v=F5JdUbyjfMA&list=PLpQebylHrdh5s3gwy-h6RtymfDpoz3vDS. By personalizing your profile with a photo of you, you encourage readers to respond.

Best regards,
Lena (SAP Community Moderator)

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