cancel
Showing results for 
Search instead for 
Did you mean: 

Thumbnails in sap.m.UploadCollection

michael_dohse2
Explorer
0 Kudos

Hi Community,

I would like to implement sap.m.UploadCollection in XML-View (I need a Picture-Upload + List). sap.m.UploadCollection seems to be the right solution beside sap.ui.unified.FileUploader.

I want to collect pics first (no instant upload) and on a later Button Click, the Upload via ODATA-service should go.

After the user selects a jpg-File, I need to show a thumbnail in the FileList. I did not find any event, I could trigger for setting a BLOB-Url to the uploaded item. Only default icon is displayed.

Does some have a solution for this?

We are using SAP UI5 version 1.38

Thanks!

michael

Accepted Solutions (0)

Answers (2)

Answers (2)

michael_dohse2
Explorer

Hi Jamie,

thanks for your answer and sorry for my late reply.

The change Event is too early, as I see no chance to manipulate the actually uploading item. The Event-object just brings Files, no UploadCollectionItem. The mapping to the item is done somewhere in the Standard coding. Adding property thumbnailUrl to the File-Object fails.

Any further ideas?

Thanks!

michael

Tri
Participant
0 Kudos

Hi Michael Dohse,

I have the same requirement to show thumbnails when uploading images.

Do you have any solutions for this?

Thanks.

Tri

jamie_cawley
Advisor
Advisor
0 Kudos

For each item in the list you can use the function setThumbnailUrl to change it as desired.

var myUC = this.byId('myUploadCollection');
var items = myUC.getItems();
items[0].setThumbnailUrl("myurl...");

The sample at

https://sapui5.netweaver.ondemand.com/sdk/explored.html#/sample/sap.m.sample.UploadCollectionForPend...

shows the events.

Regards,

Jamie

SAP - Technology RIG