Skip to Content
0
Former Member
Oct 12, 2016 at 02:07 AM

SAP UI5 UploadCollection - pending

380 Views Last edit Aug 30, 2017 at 06:50 PM 2 rev

UploadCollection (pending) control does not refresh and remove the icon and upload entry even after successful remove of the item. For example: an item has been added to teh list using hte + icon. It is entered into the upload list for uploading later but before the upload is done the user decides to leaves the page. I can force the user to manually delete the entries using the code below but would prefer to just remove the items and leave the screen. The removeItem code does the trick because when I do a getItems immedialey after removeitem the entry has been removed, the object list is empty. However, the entry/picture/icon name of file and delete icon are still showing on the screen when I come back to the page at a later stage. How can I come back to this page with a fresh start.

if (this.byId("UploadCollection").getItems().length > 0) {
MessageToast.show("Please remove attachments before navigating back");
return;
}

for (var i = 0; i < oUploadCollection.getItems().length; i++) {
oUploadCollection.removeItem(oUploadCollection.getItems()[i]);
}