Skip to Content
0

Thumbnails in sap.m.UploadCollection

Oct 24, 2016 at 05:58 AM

197

avatar image

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

10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

2 Answers

Jamie Cawley
Oct 24, 2016 at 12:25 PM
0

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.UploadCollectionForPendingUpload/preview

shows the events.

Regards,

Jamie

SAP - Technology RIG

Share
10 |10000 characters needed characters left characters exceeded
Michael Dohse Oct 28, 2016 at 01:52 PM
0

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

Share
10 |10000 characters needed characters left characters exceeded