Skip to Content

Thumbnails in sap.m.UploadCollection

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

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

2 Answers

  • Oct 24, 2016 at 12:25 PM

    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

    Add comment
    10|10000 characters needed characters exceeded

  • Oct 28, 2016 at 01:52 PM

    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

    Add comment
    10|10000 characters needed characters exceeded