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 a comment
10|10000 characters needed characters exceeded

Related questions

2 Answers

  • Posted on 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 a comment
    10|10000 characters needed characters exceeded

  • Posted on 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 a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.